#include using namespace std; int main(){ int D; cin >> D; string S1, S2; cin >> S1 >> S2; string S = S1 + S2; S += "x"; int res = 0; int acc = 0; for(char c : S){ if(c == 'o'){ ++acc; continue; } res = max(res, min(D, acc)); acc = 0; } cout << res << endl; return 0; }