def main(): n, _ = map(int, input().split()) keys = [list(input()) for _ in range(n)] ans = 1 + max(list(map(lambda x: x.count("x"), [list(x) for x in zip(*keys)]))) print(ans) if __name__ == "__main__": main()