l = input().split() t = 1 try: for i in range(10): if str(t) != l[i]: print(str(t)) break t = t + 1 except IndexError: print("10")