import scala.io.StdIn

object Main extends App {
  val n  = StdIn.readLine().toInt

  def solve(n: Int): Int = {
    var ans = 0
    (1 to n).foreach{ i =>
      if (i.toString().length % 2 != 0) ans = ans + 1
    }
    ans
  }

  println(solve(n))
}
  

