function Main(input) {
  input = parseInt(input);
  var output = 0;
  for(var i = 1; i <= input; i++){
    if(i.toString().length % 2 == 1){
       output++;
       }
  }
  console.log(output);
}

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