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