"use strict"

const main = (input) => {
    const N = parseInt(input, 10);
    let count = 0;

    for(let i = 1; i <= N; i++){
        let digitNumber = String(i).length;
        if(digitNumber % 2 !== 0){
            count += 1;
        }
    }

    console.log(count);
}

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