N = int(input())

L = [0] * 1001

for _ in range(N):
    L[input().count('^')] += 1

print(1000 - L[::-1].index(max(L)))