#include <bits/stdc++.h>

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for (int i = (int)(n - 1); i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(a) ((int)(a).size())
#define BIT(x, i) (((x) >> (i)) & 1)
#define SQ(x) ((x) * (x))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

typedef function<ll(string&, int&, int, ll&)> OpFunc;

bool op_add(string& s, int& idx, int opidx, ll& n);
bool op_sub(string& s, int& idx, int opidx, ll& n);
bool op_mul(string& s, int& idx, int opidx, ll& n);

ll expr(string& s, int& idx, int opidx);

int comb1[6][3] = {
    {0, 1, 2},
    {0, 2, 1},
    {1, 0, 2},
    {1, 2, 0},
    {2, 0, 1},
    {2, 1, 0},
};
int comb2[6][2] = {
    {3, 2},
    {2, 3},
    {4, 1},
    {1, 4},
    {5, 0},
    {0, 5},
};

vector<vector<OpFunc>> op;

ll factor(string& s, int& idx) {
    ll n = 0;
    if (s[idx] == '(') {
        idx++; // (
        n = expr(s, idx, 0);
        idx++; // )
    } else {
        while (isdigit(s[idx])) {
            n *= 10;
            n += s[idx] - '0';
            idx++;
        }
    }
    return n;
}

ll expr(string& s, int& idx, int opidx) {
    if (opidx == SZ(op)) {
        return factor(s, idx);
    } else {
        ll n = expr(s, idx, opidx+1);
        for (; idx < (int)s.length();) {
            bool ok = false;
            REP(i, SZ(op[opidx])) {
                if (op[opidx][i](s, idx, opidx, n)) {
                    ok = true;
                }
            }
            if (!ok) break;
        }
        return n;
    }
}

bool op_add(string& s, int& idx, int opidx, ll& n) {
    if (s[idx] == '+') {
        idx++;
        n += expr(s, idx, opidx+1);
        return true;
    }
    return false;
}

bool op_sub(string& s, int& idx, int opidx, ll& n) {
    if (s[idx] == '-') {
        idx++;
        n -= expr(s, idx, opidx+1);
        return true;
    }
    return false;
}

bool op_mul(string& s, int& idx, int opidx, ll& n) {
    if (s[idx] == '*') {
        idx++;
        n *= expr(s, idx, opidx+1);
        return true;
    }
    return false;
}

int main() {
    string line;
    cin >> line;
    vector<vector<OpFunc>> o;
    o.push_back({op_add});
    o.push_back({op_sub});
    o.push_back({op_mul});
    o.push_back({op_add, op_sub});
    o.push_back({op_add, op_mul});
    o.push_back({op_sub, op_mul});

    vector<vector<vector<OpFunc>>> ops;
    REP(i, 6) {
        vector<vector<OpFunc>> v;
        REP(j, 3) {
            v.push_back(o[comb1[i][j]]);
        }
        ops.push_back(v);
        v.clear();
        REP(j, 2) {
            v.push_back(o[comb2[i][j]]);
        }
        ops.push_back(v);
    }
    ops.push_back({{op_add, op_sub, op_mul}});

    ll ma = LLONG_MIN;
    REP(i, SZ(ops)) {
        op.clear();
        op = ops[i];
        int idx = 0;
        ll n = expr(line, idx, 0);
        ma = max(ma, n);
    }
    cout << ma << endl;
}

Measured memory_bytes: 3184