'use strict';

function main(stdin) {
  const input = stdin.split(' ').map(v => parseInt(v, 10));
  const N = input[0];
  let ans = 0;

  for (let i = 1; i <= N; ++i) {
    let str = i.toString(10);
    if (str.length % 2 === 1) {
      ++ans;
    }
  }
  console.log(ans);
}

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