N = int(input().strip()) S = [input().strip().count('^') for _ in range(N)] lst = [0] * 1001 for i in S: lst[i] += 1 ans = 0 cnt = 0 for n, i in enumerate(lst): if cnt <= i: cnt = i ans = n print(ans)