import java.util.*; class A { static Scanner s = new Scanner(System.in); public static void main(String[] args) { System.out.println(s.next().replaceAll("mi-*?n", "1").length()); } }