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