const line = require('fs').readFileSync('/dev/stdin','utf8').trim()
const n = parseInt(line)

var numberOfUnevenNumbers = 0
for(i=1;i<=n;i++) {
  var iString = i.toString()

  if(iString.length % 2 === 1) {
    numberOfUnevenNumbers++
  }
}

console.log(numberOfUnevenNumbers)
