#!/bin/python import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) # your code goes here type_count = [0,0,0,0,0,0] for t in types: type_count[t] += 1 mode = 0 big_freq = 0 for i in range(0,6): if type_count[i] > big_freq: big_freq = type_count[i] mode = i print "%s" % (mode)