import math import sys a = int(input()) b = list(map(int, input().split())) c = [0] * 6 for i in range(a): c[6 - b[i]] += 1 print(6 - c.index(max(c)))