n = int(input()) *x, = map(int,input().split()) r = [0]*7 for i in x: r[i] += 1 print(max(range(7)[::-1], key= lambda i:r[i]))