def compute(y): tot=[0 for i in range(6)] for i in y: tot[i]=tot[i]+1 return tot.index(max(tot)) if __name__ == "__main__": x=int(input()) y=[int(t) for t in input().strip().split()] z=compute(y) print(str(z))