const main = (inputs) => {
  var N = inputs[0].split(" ")[0]-0;
  var ans = 0;
  for(var i=1;i<=N;i++){
    if((i).toString().length%2==1)
      ans++; 
  }
  
  console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8').trim().split("\n"));
