N, M = map(int, input().split()) t = [0] * M for _ in range(N): S = input() for i in range(M): if S[i] == 'x': t[i] += 1 print(max(t) + 1)