n,m = map(int,input().split()) count = [0]*m for i in range(n): S = input() for j,s in enumerate(S): count[j] += int(s == "x") print(max(count)+1)