function main(lines) {
    const input = lines.split('\n').map(Number)[0]
    var count = 0
    for(var i=1; i<=input; i++){
        if(i.toString().split('').length % 2 === 1){
            count++
        }
    }
    console.log(count)
}

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