N=int(input()) c=[0]*6 for e in map(int,input().split()): c[6-e]+=1 print(6 - c.index(max(c)))