#include using namespace std; int main() { int D; string s, t; cin >> D; cin >> s; t += s; cin >> s; t += s; for (int i = 0; i < D; i++) { t = "x" + t; } for (int i = 0; i < D; i++) { t = t + "x"; } int res = 0; for (int i = 0; i < 14 + 2 * D; i++) { int l = i, r = i + D; int sum = 0; for (int j = 0; j < 14 + 2 * D; j++) { if (t[j] == 'o' || (l <= j && j < r)) { sum++; } else { sum = 0; } res = max(res, sum); } } cout << res << endl; return 0; }