using System; using System.Collections.Generic; using System.Text.RegularExpressions; //YukiCoder418 ミンミンゼミ //http://yukicoder.me/problems/no/418 class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("mi--nminminminmi-------n"); //5 } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); string S = InputList[0]; Console.WriteLine(Regex.Matches(S, "mi-*n").Count); } }