'use strict';
console.log(function(args){
  const N = args.trim()|0;
  let count = 0;
  for ( let i = 1; i <= N; i++ ) {
    if ( (''+i).length % 2 === 1 ) count++;
  }
  return count.toString();
}(require('fs').readFileSync('/dev/stdin', 'utf8')));