fun main(arg: Array<String>) {
    val N = nextInt()
    var ans = 0
    for (n in 1 .. N) {
        if (n.toString().length and 1 == 1) ans++;
    }
    println(ans)
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
