#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;
void yesno(bool ok, string yes = "Yes", string no = "No") {
    if (ok) {
        cout << yes << endl;
    } else {
        cout << no << endl;
    }
}

// ll expression();

// ll factor() {
//     if (S[cur] != '(') {
//         return number();
//     }
//     cur++;
//     int n = expression();
//     assert(S[cur] == ')');
//     cur += 1;
//     return n;
// }

// ll term() {
//     ll a = factor();
//     while (cur < S.size() && (S[cur] == '*' || S[cur] == '/')) {
//         char op = S[cur];
//         cur++;
//         ll b = factor();
//         if (op == '*') {
//             a *= b;
//         } else {
//             a /= b;
//         }
//     }
//     return a;
// }

// ll expression() {
//     ll a = term();
//     while (cur < S.size() && (S[cur] == '+' || S[cur] == '-')) {
//         char op = S[cur];
//         cur++;
//         ll b = term();
//         if (op == '+') {
//             a += b;
//         } else {
//             a -= b;
//         }
//     }
//     return a;
// }

string S;
ll cur = 0;

int digit() {
    assert(isdigit(S[cur]));
    int n = S[cur] - '0';
    cur++;
    return n;
}

ll number() {
    ll n = digit();
    while (cur < (ll)S.size() && isdigit(S[cur])) {
        n = n * 10 + digit();
    }
    return n;
}

ll solve(ll c1, ll c2, ll c3, ll dep);

ll factor(ll c1, ll c2, ll c3) {
    ll n;
    if (S[cur] == '(') {
        cur++;
        n = solve(c1, c2, c3, 0);
        assert(S[cur] == ')');
        cur += 1;
    } else {
        n = number();
    }
    return n;
}

ll solve(ll c1, ll c2, ll c3, ll dep) {
    ll a;
    if (dep < 3) {
        a = solve(c1, c2, c3, dep + 1);
    } else {
        a = factor(c1, c2, c3);
    }
    while (cur < (ll)S.size() && ((S[cur] == '+' && c1 == dep) ||
        (S[cur] == '-' && c2 == dep) || (S[cur] == '*' && c3 == dep))) {
        char c = S[cur];
        cur++;
        ll b;
        if (dep < 3) {
            b = solve(c1, c2, c3, dep + 1);
        } else {
            b = factor(c1, c2, c3);
        }
        if (c == '+') {
            a += b;
        } else if (c == '-') {
            a -= b;
        } else if (c == '*') {
            a *= b;
        }
    }
    return a;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> S;
    ll ans = llmin;
    REP(i, 0, 3) {
        REP(j, 0, 3) {
            REP(k, 0, 3) {
                cur = 0;
                ll num = solve(i, j, k, 0);
                // cout << num << endl;
                ans = max(ans, num);
            }
        }
    }
    cout << ans << endl;
}



Measured memory_bytes: 3232