from collections import Counter N = int(input()) A = [None] * N for i in range(N): A[i] = input() c = Counter(A) c = sorted(c.items(), key=lambda x: (x[1], x[0]), reverse=True) print(c[0][0].count('^'))