import math import sys def S(): return sys.stdin.readline().rstrip() def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int, sys.stdin.readline().rstrip().split()) def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) def LS(): return list(sys.stdin.readline().rstrip().split()) n = I() from collections import defaultdict d = defaultdict(int) for _ in range(n): s = S() d[s.count('^')] += 1 d_s = sorted(d.items(), key=lambda x:(x[1], x[0]), reverse=True) print(d_s[0][0])