#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here l=0 k=0 for i in range(0,6): h=types.count(i) if(h>k): k=h l=i print(l)