object Main {

  def main(args: Array[String]): Unit = {
    val input = io.StdIn.readLine.split(" ")
    val n = input(0).toInt
    println(solve(n))
  }

  private def solve(n: Int): Int ={
    val collection = (1 to n).toList
    def loop(range: List[Int], sum: Int): Int = {
      if (range.isEmpty) sum
      else {
        val head = range.head
        if (head.toString.length % 2 != 0) loop(range.tail, sum + 1)
        else loop(range.tail, sum)
      }
    }
    loop(collection, 0)
  }
}