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