#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define LOG(...) printf(__VA_ARGS__) //#define LOG(...) #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i) #define REP(i,n) for(int i=0;i<(int)(n);++i) #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(),(a).rend() #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define RSORT(c) sort((c).rbegin(),(c).rend()) #define CLR(a) memset((a), 0 ,sizeof(a)) typedef long long ll; typedef unsigned long long ull; typedef vector vb; typedef vector vi; typedef vector vll; typedef vector vvb; typedef vector vvi; typedef vector vvll; typedef pair pii; typedef pair pll; const int dx[] = {-1,0,1,0}; const int dy[] = {0,1,0,-1}; int main() { int d; vector week(14); cin >> d; REP(i, 14) { cin >> week[i]; } int res = d; REP(i, 14) { if (week[i] == 'o') { int n = d; for (; i < week.size() && week[i] == 'o'; i++, n++); for (int j = i + d; j < week.size() && week[j] == 'o'; j++, n++); res = max(res, n); } } cout << res << endl; }