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