n, m = map(int, input().split()) cnt = [0] * m for _ in range(n): S = input() for i in range(m): if S[i] == "x": cnt[i] += 1 print(max(cnt) + 1)