"use strict";
const main = arg => {
  let count = 0;
  for(let i = 1; i <= arg; i++){
  	if(String(i).length % 2 == 1){
      count++;
    }
  }
  console.log(count);
}

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