# -*- coding: utf-8 -*- from collections import Counter N = int(input()) C = Counter() for _ in range(N): C[input().count("^")] += 1 print(sorted(C.items(), key=lambda x: [x[1], x[0]], reverse=True)[0][0])