import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from collections import Counter N = int(readline()) data = [line.count(b'^') for line in readlines()] max_cnt = 0 answer = 0 for key, cnt in Counter(data).items(): if max_cnt < cnt: max_cnt = cnt answer = key elif max_cnt == cnt: if answer < key: answer = key print(answer)