import java.util.Scanner; public class CopyOfMain { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int D = sc.nextInt(); char[] string = ("xxxxxxxxxxxxxx" + sc.next() + sc.next() + "xxxxxxxxxxxxxx").toCharArray(); sc.close(); int max = 0; for (int i = 0; i + D < 56; i++) { char[] holidays = new char[56]; for (int j = 0; j < i; j++) { if (string[j] == 'o') { holidays[j] = 'o'; } else { holidays[j] = 'x'; } } for (int j = i; j < i + D; j++) { holidays[j] = 'o'; } for (int j = i + D; j < 56; j++) { if (string[j] == 'o') { holidays[j] = 'o'; } else { holidays[j] = 'x'; } } int cnt = 0; for (int j = 0; j < holidays.length; j++) { if (holidays[j] == 'o') { cnt++; } if (holidays[j] == 'x' || j == holidays.length - 1) { max = Math.max(max, cnt); cnt = 0; } } } System.out.println(max); } }