function Main(input) {
	input = parseInt(input,10);
	returner = 0;
  
  	for(var i=1; i<=input; i++){
		if( (""+i).split("").length%2==1 ){
        	returner++;
        }
    }
  	console.log(returner);
}


Main(require("fs").readFileSync("/dev/stdin", "utf8"));