from collections import defaultdict, Counter N = int(input()) Q = defaultdict(int) for _ in range(N): Q[input()] += 1 print(max(Counter(Q).most_common(), key = lambda E: (E[1], E[0]))[0].count("^"))