import           Control.Monad
import           Data.List.Split

main :: IO ()
main = do
  (s : ss) <- getLine
  let combi = replicateM (length ss) [True, False]

  let pairs = map (splitOn "+" . isrtPls (s : ss)) combi

  let sums  = [ (sum . map read) x | x <- pairs ]
  print $ sum sums

isrtPls :: String -> [Bool] -> String
isrtPls s [] = s
isrtPls (s : ss) (c : cs) =
  if c then s : '+' : isrtPls ss cs else s : isrtPls ss cs
