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