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