#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int d; cin >> d; string s; for (int i = 0; i < 2; i++) { string t; cin >> t; s += t; } int ans = 0; for (int i = 0; i <= 14 - d; i++) { int cnt = 0; for (int j = 0; j < 14; j++) { if(j == i) { cnt += d; j += d - 1; continue; } if(s[j] == 'o') cnt++; else cnt = 0; ans = max(ans, cnt); } } cout << ans << endl; return 0; }