n, m = map(int, input().split()) from collections import * d = defaultdict(int) for _ in range(n): s = input() for i in range(m): if s[i] == "x": d[i] += 1 ans = 0 for i in range(n): ans = max(ans, d[i]+1) print(ans)