import java.util.Scanner; public class Main{ private static Scanner sc=new Scanner(System.in); public static void main(String args[])throws Exception{ String s=sc.nextLine(); int counter=0; while(true){ if(s.indexOf("mi") == -1 || s.indexOf("n") == -1){ break; }else{ s=s.substring(s.indexOf("n")+1); counter++; } }System.out.println(counter); } }