n = int(input()) a = list(map(int,input().split())) mx = 0 res = 0 for i in range(1, 7): c = a.count(i) if c >= mx: mx = c res = i print(res)