"use strict";

const main = arg => {
    const input = arg.trim().split("\n");
    var N = parseInt(input[0], 10);
    var ans=0;
    for (var i = 1; i <= N; i++) {
       if (String(i).length%2==1) {
       	    ans=ans+1
       }
    }
    console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

