Input: Him loves him
Output: 0