import sequtils, strutils var bs = stdin.readLine.split.map parseInt ans = 10 for idx, b in bs: if idx + 1 != b: ans = succ idx break echo ans