import java.util.Scanner
fun main(args:Array<String>){
  val reader = Scanner(System.`in`);
  var N = reader.nextInt()
  var ans = 0
  for(i in 1..N)
    if((i.toString().length)%2==1)
      ++ans
  println("${ans}")
}