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