n=int(input());c,t=0,0 l=[*map(int,input().split())] for i in range(1,7): c=max(l.count(i),c) if l.count(i)==c: t=i print(t)