n = int(input()) count = [0] * 6 for i in map(int, input().split()): count[i - 1] += 1 count.reverse() print(6 - count.index(max(count)))