#!/bin/python import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) # your code goes here freq = {1: 0, 2: 0, 3:0, 4:0, 5:0} for ty in types: freq[ty] += 1 max_num = max(freq.values()) for i in xrange(1,6): if freq[i] == max_num: print i break