main :: IO ()
main = do
  input <- getLine
  let n = read input :: Int
  putStrLn . show $ executeB n

executeB :: Int -> Int
executeB n
  | n <= 9 = n
  | n <= 99 = 9
  | n <= 999 = 9 + n - 99
  | n <= 9999 = 909
  | n <= 99999 = 909 + n - 9999
  | n == 100000 = 90909