function Main(input) {
	input = input.split("\n");
	const N = parseInt(input[0])

	var keta = Math.floor(Math.log10(N))
	var count = 0

	if(keta % 2 == 0){
		count = N - Math.pow(10, keta) + 1
	}

	for(i=0; i < keta; i++){
		if(i % 2 == 0){
          count += Math.pow(10, i+1) - Math.pow(10, i)
		}
	}

	console.log(count)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));