#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF (1<<29) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() #define uniq(v) v.erase(unique(all(v)),v.end()) #define indexOf(v,x) (find(all(v),x)-v.begin()) int main(){ char c[14]; int ans=0,len=0,d; vector > v; cin>>d; rep(i,14)cin>>c[i]; rep(i,14){ if(c[i]=='o')len++; else if(len){ v.push_back(make_pair(i-len,i-1)); len=0; } ans=max(ans,len); } if(len)v.push_back(make_pair(14-len,14-1)); rep(i,(int)v.size()-1){ if(v[i+1].first-v[i].second-1<=d){ ans=max(ans,v[i+1].second-v[i].first+1); }else{ ans=max(ans,max(v[i].second-v[i].first,v[i+1].second-v[i+1].first)+1+d); } } if(v.size()){ ans=max(ans,v[0].second-v[0].first+1+min(v[0].first,d)); ans=max(ans,v.back().second-v.back().first+1+min(13-v.back().second,d)); } cout<