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