using System; using System.Linq; public class P0418 { public static void Main() { var s = Console.ReadLine().Trim(); var mflg = false; var iflg = false; var count = 0; foreach(char c in s.ToCharArray()) { if(c == 'm') { mflg = true; iflg = false; } else if(c == 'i' && mflg) { mflg = false; iflg = true; } else if(c == 'n' && iflg) { mflg = false; iflg = false; count += 1; } else if(c == '-' && iflg) { //nothing to do } else { mflg = false; iflg = false; } } Console.WriteLine(count); } }