#include #define FOR(i,a,b) for(int i = (a); i < (b); ++i) #define REP(i,n) FOR(i,0,n) #define SZ(n) (int)(n).size() #define ALL(n) (n).begin(), (n).end() using namespace std; typedef long long LL; typedef vector VI; int main() { string s; cin >> s; int ans = 0; REP(i, SZ(s)) { if (s[i] == 'm' && s[i + 1] == 'i') { for (int j = i + 2; s[j]; ++j) { if (s[j] == 'n') { ans++; i = j; break; } } } } cout << ans << endl; return 0; }