stdin.ReadLine()
|> int
|> function
   | x when x < 10 -> x
   | x when x < 100 -> 9
   | x when x < 1000 -> x - (99 - 9)
   | x when x < 10000 -> 909
   | x when x < 100000 -> x - (9999 - 909)
   | x when x = 100000 -> 90909
|> printfn "%d"