N = input().split() for i in range(1,10): if i != int(N[i-1]): print(i) break if i == 10: print("10")