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 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.
Input
The first line contains a word of length
, consisting of uppercase letters of the English alphabet.
Output
In the first and only line, print out the required number of HONI-blocks.
Sample Input 1
MAGNUS
Sample Output 1
0
Sample Input 2
HHHHOOOONNNNIIII
Sample Output 2
1
Explanation for Sample Output 2
By throwing out three letters H
, O
, N
and I
Magnus can get the word HONI
, which contains one HONI-block.
Sample Input 3
PROHODNIHODNIK
Sample Output 3
2
Comments
You need to remove the first three characters before making the judgment.Hope this helps.Wishing you happiness!
explanation of the problem is so bad that to understand it I had to forget English language
This is a reminder to not post your code in the comments. If you need help with the problem, you can visit the Discord. If you want a place to post your code, you can use a service like GitHub. If you want to be banned from making further comments, you can contact the admins.