object Main extends App {
  def f(n: Int): Int = {
    (for {
      i <- 1 to n
      if i.toString.length % 2 == 1
    } yield i).length
  }
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt
  println(f(n))
}