fun main(args: Array<String>) {
    val N = readLine()!!.toInt()

    var oddCount = 0
    for (i in 1..N) {
        if (i.toString().length % 2 == 1) {
            oddCount++
        }
    }

    println(oddCount)
}

