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