from collections import Counter print(Counter([input().count("^") for _ in range(int(input()))]).most_common()[0][0])