#include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(i=a;i> d; cin >> s >> s1; /* 入力終了! */ int x_cnt = 0; int o_first = 0; strcat(s,s1); s[14] = 'x'; int holi_cnt; int yuukyuu; int ans = 0; char go = 1; for(i=0;i<14;i++) { if(s[i] == 'x') x_cnt++; } for(i=0;i<14 && go ;i++) { if(s[i] == 'o') { for(j=i;j<14;j++) { if(s[j] != 'o'){ go = 0; break; } o_first++; } } } if(x_cnt < d) { ans = d + o_first ; } for(i=0;i<14;i++) { holi_cnt = 0; yuukyuu = d; for(j=i;j<15;j++) { if(s[j] == 'x' && yuukyuu){ for(;j<14;j++) { if(yuukyuu && s[j] == 'x') yuukyuu--; else { yuukyuu = 0;break; } holi_cnt++; } if(j == 14) holi_cnt += yuukyuu-1; } else if(s[j] == 'x' && yuukyuu == 0) break; holi_cnt++; } if(holi_cnt > ans) ans = holi_cnt; } cout << ans << endl; return 0; }