MOD = 10 ** 9 + 7 INF = 10 ** 11 import sys sys.setrecursionlimit(100000000) def main(): N = int(input()) distribution = [0] * 1000 for _ in range(N): s = input() distribution[s.count('^')] += 1 M = 0 index = -1 for i,d in enumerate(distribution): if d >= M: M = d index = i print(index) if __name__ == '__main__': main()