
function Main(input) {
    var N = parseInt(input[0], 10);
    var result = 0;

    for (var i = 1; i <= N; i++) {
        if (1 <= i && i <= 9 ||
            100 <= i && i <= 999 ||
            10000 <= i && i <= 99999) {
                result++;
        }
    }
    console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));