-- ABC 136 B
import Data.Maybe
import Data.Char
import Data.List
import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector.Unboxed as VU

main :: IO()
main = do
  n <- getInt
  print $ solve n

solve :: Int -> Int
solve n = if odd rank then m + l else l
  where
    n' = show n
    rank = length n'
    m = if rank == 1 then n else read $ tail n'
    l = sum . map (\k -> 9*10^(k-1)) $ [1,3..rank-1]

-- ByteStringを用いた入力
readInt = fst . fromJust . BS.readInt

-- 整数を一つ受け取る
getInt = readInt <$> BS.getLine

-- 長さnの整数列を受け取る
getIntVec n = VU.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

-- 空白区切りの整数列をListで受け取る
getIntList = unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine