#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here n1=n2=n3=n4=n5=0 for i in range(0,n): if types[i]==5: n5=n5+1 elif types[i]==4: n4=n4+1 elif types[i]==3: n3=n3+1 elif types[i]==2: n2=n2+1 elif types[i]==1: n1=n1+1 maxi=n5 index=5 if n4>=maxi: maxi=n4 index=4 if n3>=maxi: maxi=n3 index=3 if n2>=maxi: maxi=n2 index=2 if n1>=maxi: maxi=n1 index=1 print(index)