n,m=map(int,input().split()) cnt=[0]*m for _ in range(n): s=input() for i in range(m): if s[i]=='x': cnt[i]+=1 print(max(cnt)+1)