import java.util.Scanner; public class Minmin { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); String S = stdIn.nextLine(); int counter = 0; while (S.indexOf("mi") == 0) { S = S.substring(2); while (S.charAt(0) == '-') { S = S.substring(1); } if (S.charAt(0) == 'n') { S = S.substring(1); counter++; } } System.out.println(counter); } }