'use strict'

function main(input) {
  const n = ~~input.trim()
  let count = 0
  for (let i = 1; i <= n; i++) {
    if ((i + '').length % 2) count++
  }
  console.log(count)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
