n = int(input()) s = list(map(int,input().split())) c,v = 0,0 for i in range(1,7): if c <= s.count(i): c = s.count(i) v = i print(v)