input() L = list(map(int, input().split())) A = [] M = 0 I = 0 for i in range(7): A.append(L.count(i)) if(A[i] >= M): M = A[i] I = i print(I)