import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines D = int(readline()) C = ''.join(read().decode().split()) answer = 0 for n in range(15): for i in range(14): if i + n > 14: break x = C[i:i+n].count('x') if x <= D: answer = n print(answer)