using System.Collections.Generic; using System.Linq; using System; public class Hello { public static void Main() { var n = int.Parse(Console.ReadLine().Trim()); var t = new string('x', n); var t2 = new string('o', n); var s = t + Console.ReadLine().Trim() + Console.ReadLine().Trim() + t; var p = 0; var ans = new List(); while (p <= s.Length - n) { var a = s.IndexOf(t, p); if (p >= 0) { var a2 = s.Substring(0, a) + t2 + s.Substring(a + n); ans.Add(countO(a2)); p++; } else break; } Console.WriteLine(ans.Max()); } public static int countO(string s) { var ans = 0; var count = 0; foreach (var x in s) if (x == 'o') { count++; ans = Math.Max(ans, count); } else count = 0; return ans; } }