import Control.Applicative

func :: String -> [[String]]
func [] = [[[]]]
func xs = concat $  map (\(a,b) -> if null b then [[a]] else map (a:) (func b)) [splitAt i xs|i<-[1..length xs]]

main :: IO()
main = do
  s <- getLine
  print $ sum $ map (sum . map (read::String->Integer)) $ func s
