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