import java.util.*; public class Exercise112{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); int d = sc.nextInt(); String plus = "xxxxxxxxxxxxxx"; String weeks = plus + sc.next() + sc.next() + plus; char[] wa = weeks.toCharArray(); int max = 0; for(int i = 0; i < wa.length; i++){ if(wa[i] == 'x'){ char[] wd = Arrays.copyOf(wa, wa.length); for(int j = 0; j < d && i + j < wd.length; j++){ if(wd[i + j] == 'o'){ break; } wd[i + j] = 'o'; } int oCount = 0; for(char charInWd: wd){ if(charInWd == 'o'){ oCount++; max = Math.max(max, oCount); }else{ oCount = 0; } } } } System.out.println(max); } }