import Foundation

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

let reader=readInts()
let n:Double=Double(reader[0])
var ans:Double=0

var i:Double=1
var num:Double=9
while(i<=log10(n)){
  ans+=num
  num*=100
  i+=2
}

var comp=1
i=1
while(i<=log10(n)){
  comp*=10
  i+=1
}

if Int(log10(n))%2==0 {ans+=(Double(Int(n)%comp))+1}

print(Int(ans))