const main = input => {
  const N = parseInt(input.trim())
  let ans = 0
  for (let i = 1; i <= N; i++) {
    if (i.toString().length % 2 !== 0) {
      ans++
    }
  }

  console.log(ans)
}
// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
