from collections import defaultdict, Counter def main(): N = int(input()) animals = defaultdict(int) for _ in range(N): animals[input()] += 1 print(max(Counter(animals).most_common(), key=lambda elm: (elm[1], elm[0]))[0].count("^")) if __name__ == "__main__": main()