function Main(input) {
    input = input.split("\n");
    var line = input[0].split("");
    var digit = line.length
    var max = Math.pow(2,digit-1)-1
    var ans = 0;
    for(var i = 0; i<=max;i++){
        var temp = i.toString(2);
        temp = "0000000000"+temp;
        temp = temp.slice("-"+(digit-1));
        temp = temp.split("");
        var ansStr = "";
        for(var j =0; j<digit; j++){
            ansStr+=line[j];
            if(temp[j]==1){
                ansStr = ansStr + "+";
            }
        }
        ans += eval(ansStr);
    }
    console.log(ans);

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