import kotlin.math.pow

fun main() {
    val N = readLine()!!
    val n = N.length
    var cnt = 0

    for (i in 1..n) {
        if (i % 2 == 1) {
            val high = 10.0.pow(i).toInt()
            val low = 10.0.pow(i - 1).toInt()
            cnt += if (i == n) {
                N.toInt() - low + 1
            } else {
                high - 1 - low + 1
            }
        }
    }

    println(cnt)
}