input() l = [0] * 7 for i in list(map(int, input().split())): l[i] += 1 l2 = [] for i, x in enumerate(l): if x == max(l): l2.append(i) print(max(l2))