D = int(input()) C = list(input()) C += list(input()) C = ["x"]*D + C +["x"]*D ans = 0 if D==0: cnt = 0 for j in range(14): if C[j]=="o": cnt += 1 else: ans = max(ans,cnt) cnt = 0 ans = max(ans,cnt) else: for i in range(14+D+1): if C[i]=="x": A = C[:] cnt = 0 while cnt