B = [int(x) for x in input().split()] ch = False for i in range(9): if B[i] != i + 1: print(i + 1) ch = True break if not ch: print(10)