n=list(map(int,input().split())) for i in range(1,len(n)+1): if i != n[i-1]: print(i) exit()