import collections a=int(input()) b=[] for i in range(a): c=input() b.append(c.count('^')) d=collections.Counter(b) i=1 e=d.most_common()[0][1] answer=d.most_common()[0][0] if a>1: while d.most_common()[i][1]==e: if d.most_common()[i][0]>answer: answer=d.most_common()[i][0] i=i+1 print(answer)