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