시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB31825922588.933%

문제

Thore is a visiting scholar at a progressive university, whose 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 doesn't want to appear old-fashioned but has difficulties adapting. To condition themselves to speak properly, he -- sorry, they -- have programmed a behaviour-improving wearable 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.

입력

The first line of input is an integer $1 \leq N \leq 100\, 000$, the number of words Thore speaks. This is followed by a single line with $N$ whitespace separated words, each word consisting of up to $20$ lowercase characters a--z.

출력

The number of electrical shocks Thore receives.

예제 입력 1

9
she sheared a sheep herd and he helped her

예제 출력 1

3

출처

Contest > Swedish Coding Cup > LTH Challenge 2022 A번

  • 문제를 만든 사람: Maj Stenmark