import math import collections l = [] n = int(input()) for i in range(n): s = input() c = s.count("^") l.append(c) l.sort() l.reverse() c = collections.Counter(l) print(c.most_common(1)[0][0])