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