input() ary = [0] * 6 dat = list(map(int, input().split())) for i in dat: ary[i - 1] += 1 for i in range(6): if(ary[-(i + 1)]) == max(ary): print(6 - i) break