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