n = int(raw_input()) count = [0] * 7 mx = 0 for i in map(int, raw_input().split()): count[i] += 1 mx = max(mx, count[i]) for i in xrange(6, 0, -1): if count[i] == mx: print i break