import collections from operator import itemgetter n = int(input()) a = [] b = [] for i in range(n): s = str(input()) eye = s[1:-1] a.append(len(eye)) c = dict(collections.Counter(a).most_common()) t = max(c.values()) for key, value in c.items(): if value == t: b.append(key); print(max(b))