D = int(input()) C = input() + input() result = 0 for i in range(14 - D): t = list(C) j = i while d[j] == 'x': d[j] = 'o' j += 1 result = max(result, max(len(a) for a in ''.join(t).split('x'))) print(result)