#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef string::iterator state;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
map<char, int> mp;
string operators = "*-+";
ll ans = LONG_MIN;
ll one(state &itr);
ll two(state &itr);
ll three(state &itr);
ll number(state &itr);
ll one(state &itr) {
    ll now = two(itr);
    while(true) {
        //cerr << "one: " << *itr << endl;
        if(*itr == ')') {
            itr++;
            return now;
        }
        if(*itr == '=') return now;
        if(*itr == '-') {
            itr++;
            now -= two(itr);
            continue;
        }
        if(*itr == '+') {
            itr++;
            now += two(itr);
            continue;
        }
        if(*itr == '*') {
            itr++;
            now *= two(itr);
            continue;
        }
    }
}

ll two(state &itr) {
    ll now = three(itr);
    while(true) {
        //cerr << "tow: " << *itr << endl;
        if(mp[*itr] <= 1) {
            return now;
        }
        if(*itr == '-') {
            itr++;
            now -= three(itr);
            continue;
        }
        if(*itr == '+') {
            itr++;
            now += three(itr);
            continue;
        }
        if(*itr == '*') {
            itr++;
            now *= three(itr);
            continue;
        }
        return now;
    }
}

ll three(state &itr) {
    ll now = number(itr);
    while(true) {
        //cerr << "three: " << *itr << endl;
        //if(*itr == operators[0] || *itr == operators[1]) return now;
        if(mp[*itr] <= 2) return now;
        if(*itr == '-') {
            itr++;
            now -= number(itr);
            continue;
        }
        if(*itr == '+') {
            itr++;
            now += number(itr);
            continue;
        }
        if(*itr == '*') {
            itr++;
            now *= number(itr);
            continue;
        }
        return now;
    }
}

ll number(state &itr) {
    if(*itr == '(') {
        itr++;
        return one(itr);
    }
    ll now = 0;
    while(true) {
        //cerr << "number: " << *itr << endl;
        if(*itr < '0' || *itr > '9') return now;
        now *= 10;
        now += *itr - '0';
        itr++;
    }
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    S = S + "=";
    //sort(operators.begin(), operators.end());
    //do {
    for(mp['+'] = 1; mp['+'] <= 3; mp['+']++) {
        for(mp['-'] = 1; mp['-'] <= 3; mp['-']++) {
            for(mp['*'] = 1; mp['*'] <= 3; mp['*']++) {
                state itr = S.begin();
                ll now = one(itr);
                ans = max(ans, now);
            }
        }
    }
        //cerr << operators << " " << now << endl;
    //} while(next_permutation(operators.begin(), operators.end()));
    cout << ans << endl;
    return 0;
}

