'use strict';
function main(input) {
  const arr = input.trim().split('\n');
  const a = Number(arr[0]);
  let count = 0;

  for (let i = 0; i < a; i ++) {
    if (String(i + 1).length % 2 !== 0) {
      count ++;
    }
  }
  
  console.log(count);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));