function Main(input){
    const len  = input.trim().length;
    const s = input.trim();
    const DFS = (i, string) => {
        if (i === len-1) return string.split('+').map(Number).reduce((a,b)=>a+b);
        return DFS(i+1, string+s[i+1]) + DFS(i+1, string+'+'+s[i+1]);
    }
    console.log(DFS(0, s[0]));
}
/**
 * イメージ(125の場合)
 * (0, 1) = (1,"12") + (1,"1+2")
 *   (1,"12") = (2, "125") + (2, "12+5") 
 *   (1,"1+2") = (2, "1+25") + (2,"1+2+5")
 *      (2, "125")  = 125
 *      (2, "12+5") = 17
 *      (2, "1+25") = 26
 *      (2,"1+2+5") = 8
 *  125 + 17 + 26 + 8 = 176
 * 
 *  if (すべての数値を確認) +を連結させた数値を足していく
 *  return  (今の数値 + 次の数値) + (今の数値 "+" 次の数値(+文字列))
 */
Main(require("fs").readFileSync("/dev/stdin", "utf8"));