N = int(input()) L = [int(i) for i in input().split()] answers = [0] * 6 for i in L: answers[i - 1] += 1 tmp = [i for i in range(6) if answers[i] == max(answers)] print(max(tmp) + 1)