_ = input() cnt = [0] * 7 for e in map(int, input().split()): cnt[e] += 1 for i in range(1, 7)[::-1]: if cnt[i] == max(cnt): print(i) break