#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef string::const_iterator State;
class ParseError {};

int operate(int a, int b, char r){
    return r == '+' ? a + b : r == '-' ? a - b : a * b;
}

int number(State &begin){
    int ret = 0;
    while(isdigit(*begin)){
        ret *= 10;
        ret += *begin - '0';
        begin++;
    }
    return ret;
}
 
namespace AAA{
    int expression(State &begin);
    int factor(State &begin);    
    int expression(State &begin){
        int ret = factor(begin);
        for(;;){
            char op = *begin;
            if(op == '+' || op == '-' || op == '*'){
                begin++;                
                ret = operate(ret, factor(begin), op);
            }else{
                break;
            }
        }
        return ret;
    }
    int factor(State &begin){
        if(*begin == '('){
            begin++;
            int ret = expression(begin);
            begin++;
            return ret;
        }else{
            return number(begin);
        }
    }
}
namespace AAB{
    char a1, a2, b;
    int expression(State &begin);
    int term(State &begin);
    int factor(State &begin);    
    int expression(State &begin){
        int ret = term(begin);
        for(;;){
            char op = *begin;
            if(op == a1 || op == a2){
                begin++;                
                ret = operate(ret, term(begin), op);
            }else{
                break;
            }
        }
        return ret;
    }
    int term(State &begin){
        int ret = factor(begin);
        for(;;){
            char op = *begin;
            if(op == b){
                begin++;
                ret = operate(ret, factor(begin), op);
            }else{
                break;
            }
        }
        return ret;
    }
    int factor(State &begin){
        if(*begin == '('){
            begin++;
            int ret = expression(begin);
            begin++;
            return ret;
        }else{
            return number(begin);
        }
    }
}
namespace ABB{
    char a, b1, b2;
    int expression(State &begin);
    int term(State &begin);
    int factor(State &begin);    
    int expression(State &begin){
        int ret = term(begin);
        for(;;){
            char op = *begin;
            if(op == a){
                begin++;                
                ret = operate(ret, term(begin), op);
            }else{
                break;
            }
        }
        return ret;
    }
    int term(State &begin){
        int ret = factor(begin);
        for(;;){
            char op = *begin;
            if(op == b1 || op == b2){
                begin++;
                ret = operate(ret, factor(begin), op);
            }else{
                break;
            }
        }
        return ret;
    }
    int factor(State &begin){
        if(*begin == '('){
            begin++;
            int ret = expression(begin);
            begin++;
            return ret;
        }else{
            return number(begin);
        }
    }
}

namespace ABC{
    char a, b, c;
    int expression(State &begin);
    int term(State &begin);
    int term2(State &begin);
    int factor(State &begin);
    int expression(State &begin){
        int ret = term(begin);
        for(;;){
            char op = *begin;
            if(op == a){
                begin++;                
                ret = operate(ret, term(begin), op);
            }else{
                break;
            }
        }
        return ret;
    }
    int term(State &begin){
        int ret = term2(begin);
        for(;;){
            char op = *begin;
            if(op == b){
                begin++;
                ret = operate(ret, term2(begin), op);
            }else{
                break;
            }
        }
        return ret;
    }
    int term2(State &begin){
        int ret = factor(begin);
        for(;;){
            char op = *begin;
            if(op == c){
                begin++;
                ret = operate(ret, factor(begin), op);
            }else{
                break;
            }
        }
        return ret;
    }
    int factor(State &begin){
        if(*begin == '('){
            begin++;
            int ret = expression(begin);
            begin++;
            return ret;
        }else{
            return number(begin);
        }
    }
}

signed main(){
    string s;
    cin >> s;
    int ans = -LLONG_MAX;
    char op[] = "+-*";
    sort(op, op + 3);
    do{
        AAB::a1 = ABB::a = ABC::a = op[0];
        AAB::a2 = ABB::b1 = ABC::b = op[1];
        AAB::b = ABB::b2 = ABC::c = op[2];
        State begin = s.begin();
        int now = AAA::expression(begin);
        ans = max(ans, now);

        begin = s.begin();
        now = AAB::expression(begin);
        ans = max(ans, now);

        begin = s.begin();
        now = ABB::expression(begin);
        ans = max(ans, now);

        begin = s.begin();
        now = ABC::expression(begin);
        ans = max(ans, now);

    }while(next_permutation(op, op + 3));
    cout << ans << endl;
}


Measured memory_bytes: 3220