main = do
  s <- map charToDigit <$> getLine
  putStrLn . show $ analyze s 0 0

charToDigit x = ord x - ord '0'

analyze :: [Int] -> Int -> Int -> Int
analyze n sum buf
  | length n == 0 = sum + buf
  | otherwise = (analyze tail' (sum+buf) 0) + (analyze tail' sum (10*buf + head'))
  where
    head' = head n
    tail' = tail n
