問題一覧 > 通常問題

No.418 Min-Min Cicada

レベル : / AI推定難易度 : 98 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 715
作問者 : mayoko_ / テスター : りあん
お気に入りにしたユーザー ProblemId : 299 / 自分の提出
問題文最終更新日: 2026-06-25 01:53:28
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 148 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。