const N = parseInt(require("fs").readFileSync("/dev/stdin", "utf8"), 10);

let total = 0;
for (let i = 0; i <= N; i++) {
  if ((Math.floor(Math.log10(i)) + 1) % 2 == 1) {
    total++;
  }
}
console.log(total);
