#include #include #include using namespace std; int main() { int D, ans = 0, sum; string C = "xxxxxxxxxxxxxx", tmp; cin >> D; for (int i = 0; i < 2; ++i) { cin >> tmp; C += tmp; } C += "xxxxxxxxxxxxxx"; if (D == 0) { sum = 0; for (size_t i = 0; i < 42; ++i) { if (tmp[i] == 'o') ++sum; else { ans = max(ans, sum); sum = 0; } } } else { for (int i = 0; i < 43 - D; ++i) { sum = 0; tmp = C; tmp.replace(i, D, D, 'o'); for (size_t j = 0; j < 42; ++j) { if (tmp[j] == 'o') ++sum; else { ans = max(ans, sum); sum = 0; } } } } cout << ans; }