'use strict'

function main(s) {

  const str = s.split('\n')[0].split('');
  const n = str.length - 1;

  const dfs = (i, sum, order) => {
    if (i === n) return eval(order + s[n]);

    sum += dfs(i + 1, sum, order + s[i] + '+') + dfs(i + 1, sum, order + s[i]);

    return sum;
  }

  const ans = dfs(0, 0, '');
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
