import scala.io.StdIn

object Main {

  def keta(x: Int): Int = {
    if (x == 0) 0
    else keta(x / 10) + 1
  }
  
  def main(args: Array[String]): Unit = {
    val n = StdIn.readInt()
    val ans = (1 to n).foldLeft(0){ (acc, i) => 
      acc + keta(i) % 2
    }
    println(ans)
  }
  
}