let scan_int () = Scanf.scanf " %d" (fun x -> x)
let print_int n = Printf.printf "%d\n" n

let () =
  let n = scan_int() in
  let ans = 
    if n < 10 then n
    else if n < 100 then 9
    else if n < 1000 then n - 90
    else if n < 10000 then 909
    else if n < 100000 then n - 9090
    else 90909 in
  print_int ans
