b = list(map(int,input().split())) a = list(x for x in range(1,11)) count = 1 for i in a: if count<10: if i != b[i-1]: print(i) break else: count +=1 continue else: print(10)