N = int(input()) L = [0] * 1001 for _ in range(N): L[input().count('^')] += 1 X = max(L) print(1000 - L[::-1].index(X))