n=input() l=[ x for x in map(int,input().split())] t=[0]*7 for i in range(1,7): t[i]=l.count(i) t.reverse() print(6-t.index(max(t)))