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