

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

    var ans = 0
    for(i in (1..target)) {
        if (i.toString().length %2 ==1) {
            ans++
        }
    }
    print(ans)
}
