#!/bin/python3

import sys

highest = 0
n = int(input().strip())
types = list(map(int, input().strip().split(' ')))
# your code goes here

for i in range(1,6):
    if types.count(i) > highest:
        varhighest = i
        highest = types.count(i)
print(varhighest)