B = list(map(int,input().split())) for i in range(1,11): if i != B[i-1]: print(i) break