#include int rest[15]; main(){ int N; char S[15],S2[8]; scanf("%d%s%s",&N,S,S2); strcat(S,S2); int count = 1,index = 1; char c = S[0]; for(int i = 1;i < 14;i++){ if(S[i] != c){ rest[index] = count; count = 1; c = S[i]; index++; }else{ count++; } } rest[index] = count; int max = 0; int turn = S[0]=='x'?1:0; for(int i = 1;i < index;i++){ if(turn){ if(N >= rest[i]){ max = std::max(max,rest[i-1]+rest[i]+rest[i+1]); }else{ max = std::max(max,std::max(rest[i-1]+N,rest[i+1]+N)); } } turn = !turn; } printf("%d\n",max); }