from collections import defaultdict n = int(input()) dd = defaultdict(int) ans = -1 max_cnt = 0 for _ in range(n): s = input() cnt = s.count("^") dd[cnt] += 1 if (max_cnt < dd[cnt]) or (max_cnt == dd[cnt] and ans < cnt): max_cnt = dd[cnt] ans = cnt print(ans)