#coding:utf-8 import numpy def count_eyes(e): return e.count('^') def main(): N = int(input().strip()) l = [] for _ in range(N): l.append(count_eyes(input())) num_l = numpy.bincount(l) max_indexes = numpy.where(num_l == num_l.max()) print(max_indexes[0][-1]) if __name__ == '__main__': main()