function Main(args){

  const input = args.split(" ");
  const target = Number(input);

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


}

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