object Main {
  def main(args:Array[String]) {
    val N = readLine().toInt

    var ans = 0
    for(i <- 1 to N) {
      var count = 0
      var num = i
      while(num > 0) {
        num = num / 10
        count += 1
      }
      if(count % 2 != 0) ans += 1
    }
    println(ans)
    }
}
