This page is still under construction.

Parts of this page are still being built. What you see may change.

Culture shock

Time limit1sMemory limit1024 MB

Summary
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 1≤N≤100 0001 \leq N \leq 100\,000, the number of words Thore speaks. This is followed by a single line with NN whitespace separated words, each word consisting of up to 2020 lowercase characters a to z.

Output

The number of electrical shocks Thore receives.

Examples1

  1. Example 1

    Input
    9
    she sheared a sheep herd and he helped her
    
    Expected output
    3