class Program { static void Main(string[] args) { string inputWord = Console.ReadLine()!; List minList = new List(); string word = ""; foreach (char c in inputWord) { word += c; if (c == 'n') { minList.Add(word); word = ""; } } int count = 0; for (int i = 0; i < minList.Count; i++) { if (minList[i].Contains("mi")) { if (i + 1 != minList.Count && minList[i + 1] != "n") { count++; } else if (i + 1 == minList.Count) { count++; } } } Console.WriteLine(count); } }