fun main(args : Array<String>) {
    val N = readLine()!!.toInt()
    val ans = (1..N).filter {
        val digits = Math.log10(it.toDouble()) + 1
        digits.toInt().mod(2) == 1
    }.size
    println(ans)
}