n,m=map(int,input().split()) s=[input() for i in range(n)] print(max([sum([s[i][j]=='x' for i in range(n)]) for j in range(m)])+1)