Culture shock
Time limit1sMemory limit1024 MB
Count how many words in a sentence are he, him, she, or her, given N words on one line.
- Level
Easy1 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
Thore is a visiting scholar at a progressive university, where the administrators have decided that gendered pronouns are politically incorrect. The pronouns he, she, him, and her must be replaced with the gender neutral they and them. Thore does not want to appear old-fashioned, but has difficulties adapting. To train themselves to speak properly, he (sorry, they) has programmed a behaviour-improving wristband to analyse their speech and give them an electric shock every time he (buzz) uses one of the forbidden words (he, him, she, or her). Thore is worried that he (buzz) will be electrocuted and needs your help to determine how many electric shocks he (buzz) will receive from different sentences.
Input
The first line contains an integer , the number of words Thore speaks. This is followed by a single line with whitespace separated words, each word consisting of up to lowercase characters a to z.
Output
The number of electrical shocks Thore receives.