#include #include #include #include using namespace std; int main(){ int d; cin>>d; string s,s2,s3,s4; cin>>s; cin>>s2; s+=s2; int f=s.find_first_of('o'); int l=s.find_last_of('o'); s3=s; s4=s; for(int i=0; im1) m1=a; a=0; } } int m2=0; int b=0; for(int i; i<=s4.size(); ++i){ if(s4[i]=='o'){ b+=1; } else { if(b>m2) m2=b; b=0; } } int c=0,d2,e; vector> v; for(int i=0; i t=make_tuple(e-d2,d2,e-1); v.push_back(t); } else { tuple t=make_tuple(d,d2,d2+d-1); v.push_back(t); t=make_tuple(d,e-1-d+1,e-1); v.push_back(t); } } } if(c==1){ e=s.size(); c=0; if(e-d2<=d){ tuple t=make_tuple(e-d2,d2,e-1); v.push_back(t); } else { tuple t=make_tuple(d,d2,d2+d-1); v.push_back(t); t=make_tuple(d,e-1-d+1,e-1); v.push_back(t); } } int m3=0; for(int i=0; i(v[i]); int f2=get<2>(v[i]); for(int i2=f1; i2<=f2; ++i2){ s4[i2]='o'; } int g=0; for(int i2=0; i2m3) m3=g; g=0; } } if(g!=0){ if(g>m3) m3=g; g=0; } } int m=max(m1,max(m2,m3)); cout<