import Data.Char
main = do
  xs <- map  digitToInt <$> getLine :: IO [Int]
  print $ sum $ dfs xs []
  
dfs :: [Int] -> [Int] -> [Int]
dfs [] ys = ys
dfs (x:xs) [] = dfs xs [x]
dfs (x:xs) (y:ys) =
  let
    t = dfs xs (x:y:ys)
    a = dfs xs ((x+10*y):ys) 
  in
    t ++ a