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