main = do
  li <- getLine
  let n = read li
  let ans = compute n
  print ans

compute :: Int -> Int
compute n
 | n < 10 = n
 | n < 100 = 9
 | n < 1000 = 9 + n - 99
 | n < 10000 = 9 + 900
 | n < 100000 = 9 + 900 + n - 9999
 | otherwise = 9 + 900 + 90000
