#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
#include <map>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = (ll)1e9 + 7;
const int MAX_N = (ll)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) { for(ll i = 0; i < (ll) v.size(); i++) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }
struct Parser
{
    map<char, int> priority;
    Parser(const map<char, int> &mp) : priority(mp) {}
    ll calc(const ll &a, const ll &b, const char &ch)
    {
        if(ch == '+') return a + b;
        else if(ch == '-') return a - b;
        return a * b;
    }
    ll number(auto &pos)
    {
        ll res = 0;
        while(isdigit(*pos))
        {
            res *= 10;
            res += *pos - '0';
            pos++;
        }
        return res;
    }
    ll factor(auto &pos)
    {
        if(*pos == '(')
        {
            pos++;
            ll res = expression(pos);
            pos++;
            return res;
        }
        else return number(pos);
    }
    ll term2(auto &pos)
    {
        ll res = factor(pos);
        while(true)
        {
            bool flag = false;
            for(auto &x : priority)
            {
                if(x.second == 2 and *pos == x.first)
                {
                    pos++;
                    flag = true;
                    res = calc(res, factor(pos), x.first);
                }
            }
            if(flag == false) break;
        }
        return res;
    }
    ll term1(auto &pos)
    {
        ll res = term2(pos);
        while(true)
        {
            bool flag = false;
            for(auto &x : priority)
            {
                if(x.second == 1 and *pos == x.first)
                {
                    pos++;
                    flag = true;
                    res = calc(res, term2(pos), x.first);
                }
            }
            if(flag == false) break;
        }
        return res;
    }
    ll expression(auto &pos)
    {
        ll res = term1(pos);
        while(true)
        {
            bool flag = false;
            for(auto &x : priority)
            {
                if(x.second == 0 and *pos == x.first)
                {
                    pos++;
                    flag = true;
                    res = calc(res, term1(pos), x.first);
                }
            }
            if(flag == false) break;
        }
        return res;
    }
};
signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s; cin >> s;
    ll ans = numeric_limits<ll>::min();
    map<char, int> mp;
    for(int i = 0; i < 3; i++)
    {
        for(int j = 0; j < 3; j++)
        {
            for(int k = 0; k < 3; k++)
            {
                mp['+'] = i;
                mp['-'] = j;
                mp['*'] = k;
                Parser p(mp);
                auto pos = s.begin();
                ll tmp = p.expression(pos);
                ans = max(ans, tmp);
            }
        }
    }
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 3272