x = [int(x) for x in input().split()] if x == [1,2,3,4,5,6,7,8,9]: print(10) for i in range(0,9): if x[i] != i + 1: print(i+1) break