#include<iostream>

using namespace std;

int main(){

   string S;
   cin>> S;

   int f=0;
   char pre='z';
   int ans=0;
   for(int i=0; i<S.size(); i++){
      char c=S[i];
      if(c=='m'){
         if(f==1){
            f=0;
         }else{

         }
      }else if(c=='i'){
         if(pre=='m'){
            f=1;
         }else{
            f=0;
         }
      }else if(c=='-'){
         if(f==1){

         }else{

         }
      }else if(c=='n'){
         if(f==1){
            ans++;
         }
         f=0;
      }else{
         f=0;
      }
      pre=c;
   }

   cout<< ans<< endl;

   return 0;
}