N = input() l = list(map(int, input().split())) number = 0 count = 0 for i in range(1,7): if count <= l.count(i): count = l.count(i) number = i print (number)