import Control.Applicative
import Control.Monad
import Data.List

eval :: String -> Int
eval xs = sum . fmap read . words
        $ fmap (\c -> if c == '+' then ' ' else c) xs

f :: String -> [Bool] -> String
f xs bs = concat $ zipWith (\x b -> (g b) ++ [x]) xs bs
  where
    g True  = "+"
    g False = ""

main :: IO ()
main = do
    ss <- getLine
    let bss = fmap (False:) $ sequence (replicate (length ss - 1) [True, False])
    let cs = fmap (f ss) bss
    let ds = fmap eval cs
    print (sum ds)