#include using namespace std; int main(){ string S; cin >> S; int ans = 0; while(!S.empty()){ S.erase(S.find('m'),S.find('n')+1); ans++; } cout << ans << endl; return 0; }