import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt

  val res = n match{
    case x if x <= 9 => x
    case x if x <= 99 => 9
    case x if x <= 999 => 9 + (x - 100 + 1)
    case x if x <= 9999 => 9 + 900
    case x if x <= 99999 => 9 + 900 + (x - 10000 + 1)
    case x if x <= 100000 => 9 + 900 + 90000
  }

  println(res)

}
