N = int(input()) L = list(map(int, input().split())) NL = [0] * 7 for i in L: NL[i] += 1 ans = [i for i in range(7) if NL[i] == max(NL)] print(max(ans))