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