// Atcoder136 - B
function main(input) {
  var inputs = input.split('\n');
  var n = parseInt(inputs[0], 10);

  var counter = 0;
  for (var i = 1; i <= n; i++) {
    counter += `${i}`.length % 2 == 1 ? 1 : 0;
  }
  console.log(counter);
}

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