#include #include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main(){ int n, ans = -1; string days, s; cin >> n >> days >> s; days += s; for (int i = 0; i < 13 - n; i++) { string tmp = days; int cnt = 0; for (int j = i; j < i + n; j++){ tmp[j] = 'o'; } for (int j = 0; j < 14; j++){ if (tmp[j] == 'o') cnt++; else { ans = max(ans, cnt); cnt = 0; } if (j == 13 && cnt) ans = max(ans, cnt); } } cout << ans << endl; }