N, M = map(int, input().split()) lock = [0]*M for i in range(N): S = input() for j in range(M): if S[j] == 'x': lock[j] += 1 print(max(lock)+1)