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