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 day = 0; day <= D; day++) { slide: for (int i = 0; i + day < 42; i++) { char[] holidays = new char[42]; for (int j = 0; j < 42; j++) { if (j < i) { if (string[j] == 'o') { holidays[j] = 'o'; } else { holidays[j] = 'x'; } } else if (j < i + day) { if (string[j] == 'o') { continue slide; } else { holidays[j] = 'o'; } } else { 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); } }