#!/bin/python import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) # your code goes here counter = [0]*6 for i in types: counter[i] += 1 print(counter.index(max(counter)))