// yukicoder: No.418 ミンミンゼミ // 2019.4.15 bal4u #include char S[105]; int main() { int ans; char *p; scanf("%s", S); ans = 0, p = S; while (*p) { if (*p == 'm' && *(p + 1) == 'i') { p += 2; while (*p == '-') p++; if (*p == 'n' && ( *(p+1) == 0 || *(p + 1) == 'm' && *(p + 2) == 'i')) { ans++, p++; } } else p++; } printf("%d\n", ans); return 0; }