open System

let N = stdin.ReadLine()|>int
[<EntryPoint>]
let main argv =
    let rec keta n = if n  < 10 then 1 else (keta (n/10))+1 
    
    [1..N]
    |>Seq.sumBy(fun m ->  if (keta m) % 2 <> 0 then 1 else 0)
    |>stdout.WriteLine
    0
   