from collections import Counter n = int(input()) a = [] for i in range(n): s = input() a.append(s.count('^')) c = Counter(list(reversed(sorted(a)))) print(c.most_common(1)[0][0])