proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" ,discardable.} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': return result = 10 * result + k.ord - '0'.ord let l = scan() let r = scan() let m = scan() echo m.min(r - l + 1)