var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});

var N;
reader.on('line', (l) => {
  N = l;
});

reader.on('close', () => {
  var odd = 0;
  for (var i = 0; i < N; i++) {
    odd += digit_num(i + 1) % 2;
  }
  console.log(odd);
});

function digit_num(n) {
  var num = 1;
  while (n >= 10) {
    num++;
    n /= 10;
  }
  return num;
}