main :: IO ()
main = do
  n <- readLn
  print $ ans n

ans :: Int -> Int
ans 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