import Data.Char
main = do
  s <- getLine
  print $ foldl (+) 0 $ map eval $ sss' (s, 1) (length s)

ss'' :: (String, Int) -> [(String, Int)]
ss'' (xs, n) = [((take n xs)++"+"++(drop n xs), n+2), (xs, n+1)]

sss' :: (String, Int) -> Int -> [String]
sss' s n = 
  if n == 1
  then return $ fst s
  else do
    s' <- ss'' s
    sss' s' (n-1)

eval :: String -> Int
eval s = let xs = foldl e [0] s in
           if length xs == 1
           then head xs
           else head xs + last xs

e :: [Int] -> Char -> [Int]
e (n:(-1):m:xs) '+' = (-1):(n+m):xs
e xs '+' = (-1):xs
e ((-1):xs) n = (digitToInt n):(-1):xs
e (n:xs) m = (n*10 + (digitToInt m)):xs
