#include #include #include #include #include #include using namespace std; typedef long long int ll; typedef pair pii; typedef vector vi; #define REP(i,x) for(int i=0;i<(int)(x);i++) #define ALL(container) (container).begin(), (container).end() int main(int argc, char *argv[]){ ios::sync_with_stdio(false); int n; cin >> n; string f; string s; cin >> f; cin >> s; const string m = "xxxxxxxxxxxxxx" + f + s + "xxxxxxxxxxxxxx"; int maxValue = 0; { int current = 0; for(int j = 0;j < m.length();j++) { if(m[j] == 'o') { current++; maxValue = max(maxValue, current); } else { current = 0; } } } for(int i = 0; i < m.length();i++) { if(m[i] == 'o') { continue; } int current = 0; bool seq = true; for(int j = 0;j < m.length();j++) { if(j >= i && j < i + n && seq) { if(m[j] == 'o') { seq = false; } current++; maxValue = max(maxValue, current); } else if(m[j] == 'o') { current++; maxValue = max(maxValue, current); } else { current = 0; } } } cout << maxValue << endl; return 0; }