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