No.418 Min-Min Cicada
Problem Statement
A min-min cicada (robust cicada) is singing. You decided to count how many times the cicada sang "miin".
You are given a string $S$ representing how the cicada sang. This string is formed by repeating "miin strings", defined below, some number of times, and by counting the number of repetitions you can count how many times the cicada sang "miin".
- It starts with "mi".
- It is then followed by some number of "-". The number of "-" may be 0.
- It ends with "n".
For example, "min" and "mi---n" are miin strings, while "mi--nn", "m--n", and so on are not miin strings.
Your task is to count how many miin strings the string $S$ consists of.
Input
$S$
The string $S$ representing the cicada's song is given as input.
$3 \leq |S| \leq 100$
It is guaranteed that $S$ is formed by repeating miin strings.
Output
Output how many times the cicada sang "miin". Print a newline at the end.
Sample
Sample 1
Input
mi--nminminminmi-------n
Output
5
There are 5 "miin strings": "mi--n", "min", "min", "min", and "mi-------n".
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
mayoko_
りあん