from collections import * N = int(input()) C = Counter() for i in range(N): C[list(input()).count("^")] += 1 print(C.most_common()[0][0])