n = int(input()) c = {} for i in range(n): x = input().count('^') if not x in c: c[x] = 1 else: c[x] += 1 y = max(c.values()) l = [] for i in c: if c[i] == y: l.append(i) print(max(l))