package No400番台; import java.util.Scanner; public class Q418 { public static void main(String[] args) { new Q418().solver(); } void solver() { Scanner sc = new Scanner(System.in); char[] c = sc.next().toCharArray(); int ans = 0; for (int i = 0; i < c.length; i++) { if (c[i] - 'm' == 0) ans++; } System.out.println(ans); } }