#!/bin/python3 import sys from collections import Counter n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here common = Counter(types) biggest = common.most_common(1) final = [] for bird in biggest: final.append(bird[0]) print(min(final))