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