B=list(map(int,input().split())) c=1 if B[-1] == 9: print(10) else: for i in B: if c != i: print(c) break c += 1