시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 135 64 59 46.094%

문제

Magnus lost a game of chess to Kile so he found comfort in competitive programming. Very soon, he heard of the iconic COCI competition and decided to try his luck there.

He wrote a mail to Kile: “Dear Kile, please, prepare me for COCI. Magnus”.

Kile replied: “You want to participate in COCI? All right, here's your warm-up task. A series of four consecutive letters of some word that make up the subword “HONI” (Croatian acronym for COCI) is called the HONI-block. I will send you the word of length N and you will throw out as many letters as you want (it might be none as well) so that in the end there are as many HONI-blocks as possible in the word. Kile”.

Magnus was very worried and asked you, COCI competitive scene, for help. Help him determine the maximum number of HONI-blocks he can get in the final word.

입력

The first line contains a word of length N (1 ≤ N ≤ 100 000), consisting of uppercase letters of the English alphabet.

출력

In the first and only line print out the required number of HONI-blocks.

예제 입력 1

MAGNUS

예제 출력 1

0

예제 입력 2

HHHHOOOONNNNIIII

예제 출력 2

1

Explanation of the second sample test:

By throwing out three letters ‘H’, ‘O’, ‘N’ or ‘I’ Magnus can get the word “HONI”, which contains one HONI-block.

예제 입력 3

PROHODNIHODNIK

예제 출력 3

2