function Main(input) {
  var N = parseInt(input)

  var answer = 0

  for (var i = 1; i <= N; i++) {
    if (String(i).length % 2 !== 0) {
      answer++
    }
  }

  console.log(answer)
}

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