import sys input = sys.stdin.readline N=int(input()) C=[0]*1010 for i in range(N): S=input().strip() C[len(S)-2]+=1 MAX=max(C) ind=-1 for i in range(1010): if C[i]==MAX: ind=i print(ind)