function Main(s) {
  var s = s.split("\n")[0];
  var n = s.length - 1;
  var ans = 0;
  for (var bit = 0; bit < 1<<n; bit++) {
    var ops = new Array(n);
    for (var i = 0; i < n; i++) {
      if (bit & (1<<i)) {
        ops[i] = "+";
      } else {
        ops[i] = "";
      }
    }
    var a = s[0];
    for (var j = 0; j < n; j++) {
      a += ops[j] + s[j + 1];
    }
    ans += eval(a);
  }
  console.log(Math.max(ans, Number(s)));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));