#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define BOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

#define MOD 1000000007


int stoint(string s){
    int res=0;
    REP(i,s.size()){
        res*=10;
        res+=s[i]-'0';
    }
    return res;
}

ll stointl(string s){
    ll res=0;
    REP(i,s.size()){
        res*=10;
        res+=s[i]-'0';
    }
    return res;
}


class Source{
private:
    string str;
    int pos;
    
public:
    int peek(){
        if(pos<str.size())return str[pos];
        return -1;
    }
    
    void next(){
        pos++;
    }
    
    void init(string _str){
        str=_str;
        pos=0;
    }
    
};


class ParserFourArithmeticOperation{
private:
    Source src;
    
public:
    ParserFourArithmeticOperation(string str){
        src.init(str);
    }
    
    bool isDigit(char s){
        if(s>='0'&&s<='9')return true;
        return false;
    }
    
    int number(){
        string res;
        while(src.peek()!=-1&&isDigit(src.peek())){
            res+=src.peek();
            src.next();
        }
        return stoint(res);
    }
    
    int expr(){
        int x=term();
        while(true){
            switch(src.peek()) {
                case '+':
                    src.next();
                    x+=term();
                    continue;
                case '-':
                    src.next();
                    x-=term();
                    continue;
            }
            break;
        }
        return x;
    }
    
    int term(){
        int x=factor();
        while(true){
            switch(src.peek()){
                case '*':
                    src.next();
                    x*=factor();
                    continue;
                case '/':
                    src.next();
                    x/=factor();
                    continue;
            }
            break;
        }
        return x;
    }
    
    int factor(){
        if(src.peek()=='('){
            src.next();
            int res=expr();
            if(src.peek()==')'){
                src.next();
            }
            return res;
        }
        return number();
    }
    
};

int main(){
    
    string s;
    cin>>s;
    
    if(s.size()==1){
        cout<<s<<endl;
        return 0;
    }
    
    ll ans=0;
    for(int i=1;i<(1<<(s.size()-1))-1;i++){
        string t=s;
        REP(j,s.size()-1){
            if((i>>j)&1){
                t.insert(t.begin()+(s.size()-1-j),'+');
            }
        }
        ParserFourArithmeticOperation inst(t);
        ans+=inst.expr();
    }
    
    ans+=stointl(s);
    REP(i,s.size())ans+=s[i]-'0';
    cout<<ans<<endl;
    
    return 0;
}

Measured memory_bytes: 256