N, M = map(int, input().split()) ans = [1] * M for _ in range(N): s = input() for j in range(M): ans[j] += s[j] == "x" print(max(ans))