from collections import Counter N, *S = open(0) C = Counter(s.count("^") for s in S) ma = C.most_common()[0][1] ans = 0 for k, v in C.items(): if v == ma: ans = max(ans, k) print(ans)