n = int(input()) dct = {} for i in range(n): inp = input() c = inp.count('^') dct.setdefault(c,0) dct[c] += 1 mx = max(dct.values()) ls = [i for i,j in dct.items() if j == mx] print(max(ls))