import java.util.*; import java.util.stream.Stream; public class No418 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next().replace("-", ""); int count = 0; for(int i = 0; i < s.length(); i = i + 3) { if(s.charAt(i) == 'm' && s.charAt(i + 1) == 'i' && s.charAt(i + 2) == 'n') { if(i + 3 == s.length()) { count++; }else if(s.charAt(i + 3) != 'n') { count++; } } } System.out.println(count); } }