#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+15); scanf("%s", s+15+7); s[15+7+7] = 'x'; int res = 0; for (int i = 0; i < 77; i++) { memcpy(t, s, sizeof(s)); for (int j = 0; j < d; j++) { s[i+j] = 'o'; } for (int j = 0; j < 99; 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; }