#include using namespace std; int main(){ int d; cin >> d; string c1,c2; cin >> c1 >> c2; c1 = "xxxxxxxxxxxxxx" + c1 + c2 + "xxxxxxxxxxxxxx"; int ans = 0; for(int i = 0; i < c1.size() - ans; i++){ int count = 0, check = 0; bool flag = false; for(int j = i; j < c1.size(); j++){ if(c1[j] == 'o' and check > 0) flag = true; if(c1[j] == 'x'){ if(check == d or flag) break; check++; } count++; } ans = max(count,ans); } cout << ans << endl; return 0; }