import java.util.*
 
fun main(args: Array<String>) {
  var num = readLine()!!

  when(num.length) {
    1 -> {
      println(num.toInt())
    }
    2 -> {
      println(9)
    }
    3 -> {
      println(9 + num.toInt() - 99)
    }
    4 -> {
      println(9 + 900)
    }
    5 -> {
      println(9 + 900 + num.toInt() - 9999)
    }
    6 -> {
      println(9 + 900 + 90000)
    }
  }
}