#include int main(void){ char S[101]; int start = 0,goal = 100; // goalは100で固定 int count = 0; scanf("%s",S); for(int i = start; S[i] != 0; i++){ if((S[i] == 'm')&&(S[i+1] == 'i')){ // nを探す for(int j = i; S[j] != 0; j++){ if(S[j] == 'n'){ goal = j; } } // 判定 if(goal != 100){ count++; start = goal; goal = 100; // 初期化 } } } printf("%d\n",count); return 0; }