#include #include #include #include using namespace std; int main(void) { int d; char s[111], t[111]; memset(s, 'x', sizeof(s)); scanf("%d", &d); scanf("%s", s+14); scanf("%s", s+14+7); int res = 0; for (int i = 0; i < 43; i++) { memcpy(t, s, sizeof(s)); for (int j = 0; j < d; j++) { s[j+i] = 'o'; } for (int j = 0; j < 42; j++) { if (s[j] == 'o') { int c = 1; while (s[j+c] == 'o') { c++; } res = max(res, c); } } memcpy(s, t, sizeof(t)); } printf("%d\n", res); return 0; }