function Main(input) {
	if(input<10){
		console.log(input);
	}else if(input<100){
		console.log(9)
	}else if(input<1000){
		console.log(input-90)
	}else if(input<10000){
		console.log(909)
	}else if(input<100000){
		console.log(input-9090)
	}else{
		console.log(90909)
	}
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
