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

long long expr(State& begin,const long long& a,const long long& b,const long long& c);
long long term(State& begin,const long long& a,const long long& b,const long long& c);
long long term2(State& begin,const long long& a,const long long& b,const long long& c);
long long fact(State& begin,const long long& a,const long long& b,const long long& c);
long long number(State& begin,const long long& a,const long long& b,const long long& c);

long long expr(State& begin,const long long& a,const long long& b,const long long& c){
    long long res = term(begin,a,b,c);
    while(true){
        if(*begin == '+' && a == 1){
            begin++;
            res += term(begin,a,b,c);
        }else if(*begin == '-' && b == 1){
            begin++;
            res -= term(begin,a,b,c);
        }else if(*begin == '*' && c == 1){
            begin++;
            res *= term(begin,a,b,c);
        }else{
            break;
        }
    }
    return res;
}

long long term(State& begin,const long long& a,const long long& b,const long long& c){
    long long res = term2(begin,a,b,c);
    while(true){
        if(*begin == '+' && a == 2){
            begin++;
            res += term2(begin,a,b,c);
        }else if(*begin == '-' && b == 2){
            begin++;
            res -= term2(begin,a,b,c);
        }else if(*begin == '*' && c == 2){
            begin++;
            res *= term2(begin,a,b,c);
        }else{
            break;
        }
    }
    return res;
}

long long term2(State& begin,const long long& a,const long long& b,const long long& c){
    long long res = fact(begin,a,b,c);
    while(true){
        if(*begin == '+' && a == 3){
            begin++;
            res += fact(begin,a,b,c);
        }else if(*begin == '-' && b == 3){
            begin++;
            res -= fact(begin,a,b,c);
        }else if(*begin == '*' && c == 3){
            begin++;
            res *= fact(begin,a,b,c);
        }else{
            break;
        }
    }
    return res;
}

long long fact(State& begin,const long long& a,const long long& b,const long long& c){
    if(*begin == '('){
        begin++;
        long long res = expr(begin,a,b,c);
        begin++;
        return res;
    }
    return number(begin,a,b,c);
}

long long number(State& begin,const long long& a,const long long& b,const long long& c){
    long long res = 0;
    while(isdigit(*begin)){
        res *= 10;
        res += *begin - '0';
        begin++;
    }
    return res;
}

int main(){
    string S;
    cin >> S;
    State begin = S.begin();
    long long ans = expr(begin,1,1,1);
    long long v[] = {1,2,3};
    for(auto a:v)for(auto b:v)for(auto c:v){
        begin = S.begin();
        ans = max(ans,expr(begin,a,b,c));
    }
    cout << ans << endl;
}
