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