import java.util.*; import java.util.regex.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { String s = sc.next(); Pattern p = Pattern.compile("mi-*n"); String ret = p.matcher(s).replaceAll("-"); System.out.println(ret.length()); } }