import sys readline=sys.stdin.readline N,M=map(int,readline().split()) cnt=[0]*M for _ in range(N): S=readline().rstrip() for j in range(M): if S[j]=="x": cnt[j]+=1 ans=max(cnt)+1 print(ans)