using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace foryuki { class Program { static void Main(string[] args) { int D = int.Parse(Console.ReadLine()); string str = ""; for (int i = 0; i < D; i++) { str += "x"; } str += Console.ReadLine() + Console.ReadLine(); for (int i = 0; i < D + 1; i++) { str += "x"; } char[] C = str.ToCharArray(); //---------------------------------- int max = 0; int cnt; int j; int q; for (int i = 0; i < C.Length - D; i++) { q = D; cnt = 0; j = i; while (C[j] == 'o') { cnt++; j++; } //------ while (C[j] == 'x' && q > 0) { q--; cnt++; j++; } //------- while (C[j] == 'o') { cnt++; j++; } max = Math.Max(max, cnt); } Console.WriteLine(max); } //------------------------------------------------------------- static int[] ConvertStringArrayToIntArray(string[] str) { int[] b = Array.ConvertAll(str, delegate(string value) { return int.Parse(value); }); return b; } static List ConvertStringArrayToIntList(string[] str) { var list = new List(); foreach (var c in str) { list.Add(int.Parse(c)); } return list; } } }