input = require('fs').readFileSync(process.stdin.fd, 'utf8')
lines = input.split('\n')
N = lines.shift() * 1
ans = 0
for (i = 1; i <= N; i++) {
    if (((i + '').length) % 2 == 1) {
        ans++
    }
}
console.log(ans)
