N = input() A = map(int, input().split()) L = [0,0,0,0,0,0,0] for x in A: L[x] += 1 L.reverse() print(6 - L.index(max(L)))