B = set(map(int, input().split())) for i in range(1, 10): if i not in B: print(i) break