#!/bin/python import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) # your code goes here count = {i:0 for i in xrange(1, 6)} for type in types: count[type] += 1 print max(count, key=count.get)