n, m = map(int, input().split()) key = [0] * m for i in range(n): for j, k in enumerate(input()): if k == "x": key[j] += 1 print(max(key)+1)