a = [int(i) for i in input().split()] for i in range(10): if i+1 not in a: print(i) break