n, m = map(int, input().split()) d = [0] * m for i in range(n): s = input() for i in range(m): if s[i] == 'x': d[i] += 1 print(max(d) + 1)