import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String S = scan.next(); scan.close(); int cnt = 0; int ans = 0; for(int i = 0; i < S.length(); i++) { char c = S.charAt(i); if(cnt == 0 && c == 'm') { cnt ++; }else if(cnt == 1 && c == 'i') { cnt ++; }else if(cnt == 2 && c == 'n') { cnt ++; ans ++; }else if(cnt == 3) { cnt = 0; if(c == 'm') { cnt ++; } } } System.out.println(ans); } }