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