n=int(input()) l=list(map(int,input().split())) le=[0]*6 for i in l: le[6-i]+=1 maxi=max(le) for i in range(6): if le[i]==maxi: print(6-i) exit()