n = int(raw_input()) l = map(int, raw_input().split()) p = [0 for _ in range(6)] for i in l: p[6-i] += 1 print 6 - p.index(max(p))