import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let nb=readInts()
let n=nb[0]

var i:Double=1
var ans=0

while(i<=Double(n)){
  if(Int(log10(i))%2==0) {ans+=1}
  i+=1
}
print(ans)