#include using namespace std; int main() { int D; vector holiday(14 * 3); cin >> D; for (int i = 0; i < 14; i++) { char c; cin >> c; if (c == 'o') holiday[i + 14] = 1; } int ans = 0; for (int i = 0; i < 14 * 3; i++) { auto book = holiday; for (int j = i; j < min(14 * 3, i + D); j++) { if (book[j]) break; book[j] = 1; } int now = 0; for (int j = 0; j < 14 * 3; j++) { if (book[j]) now++; else now = 0; ans = max(ans, now); } } cout << ans << endl; }