import java.util.Scanner; public class no2 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.next(); int n = s.length(); int st1 = 0; int st2 = 0; int count = 0; for(int j = 0;j < n;j++){ char c = s.charAt(j); if(st1==0 && st2 ==0){ if(c=='m') { st1 = 1; } }else if(st1==1 && st2==0){ if(c=='i') { st2 = 1; st1 = 0; }else{ st1=0; } }else if(st1==0 && st2==1){ if(c=='-'){} else if(c=='n'){ count +=1; st2 = 0; }else{ st2 = 0; } } System.out.print(count); } } }