import Text.Parsec
import Text.Parsec.String
import Control.Monad
eval :: Parser Int
eval = do
    n <- read <$> many1 digit
    do  char '+'
        e <- eval
        return (n + e)
        <|> return n

main = do
    str <- getLine
    let exprs = map concat $ mapM (\x ->[[x],x:"+"]) str
        vals = map ((\x -> case x of Left _ -> 0;Right n -> n).parse eval "") exprs
    print $ sum vals