n, m = map(int, input().split()) d = [n + 1] * m for _ in range(n): for i, c in enumerate(input()): if c == 'o': d[i] -= 1 print(max(d))