#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

class Calc {
    string str;
    vector<char> p;
    string::iterator it;
 
  public:
    Calc(const string &str, vector<char> p){
	this->str = str;        
	this->p   = p;
        it        = this->str.begin();    
    }

    ll get_val(ll a, char op, ll b)
    {
        switch (op) {
            case '*':
                return a * b;
            case '+':
                return a + b;
            case '-':
                return a - b;                
        }
        assert(0);
    }
    
    ll f0()
    {
        ll res = 0;
	if (*it == '(') {
	    ++it;
	    res = f3();
	    ++it;
	} else {
	    while (isdigit(*it)) {
		res *= 10LL;
		res += (ll)(*it - '0');
		++it;
	    }
	}
        return res;
    }
 
    ll f1()
    {
	ll res = f0();
	while (*it == p[0]) {
            ++it;            
            res = get_val(res, p[0], f0());
	}
	return res;
    }

    ll f2()
    {
        ll res = f1();
        while (*it == p[1]) {
            ++it;
            res = get_val(res, p[1], f1());
        }
        return res;
    }
        
    ll f3()
    {
	ll res = f2();
	while (*it == p[2]) {
            ++it;
            res = get_val(res, p[2], f2());
	}
	return res;
    }
};

class Calc2 {
    string str;
    vector<char> p;
    string::iterator it;
  
  public:
    Calc2(const string &str, vector<char> p){
        this->str = str;        
        this->p   = p;
        it        = this->str.begin();    
    }
 
    ll get_val(ll a, char op, ll b)
    {
        switch (op) {
            case '*':
                return a * b;
            case '+':
                return a + b;
            case '-':
                return a - b;                
        }
        assert(0);
    }
     
    ll f0()
    {
        ll res = 0;
        if (*it == '(') {
            ++it;
            res = f2();
            ++it;
        } else {
            while (isdigit(*it)) {
                res *= 10LL;
                res += (ll)(*it - '0');
                ++it;
            }
        }
        return res;
    }
  
    ll f1()
    {
        ll res = f0();
        while (*it == p[0]) {
            ++it;            
            res = get_val(res, p[0], f0());
        }
        return res;
    }
 
    ll f2()
    {
        ll res = f1();
        while (*it == p[1] || *it == p[2]) {
            if (*it == p[1]) {
                ++it;
                res = get_val(res, p[1], f1());                
            } else {                               
                ++it;
                res = get_val(res, p[2], f1());                
            }
        }
        return res;
    }
};

class Calc22 {
    string str;
    vector<char> p;
    string::iterator it;
  
  public:
    Calc22(const string &str, vector<char> p){
        this->str = str;        
        this->p   = p;
        it        = this->str.begin();    
    }
 
    ll get_val(ll a, char op, ll b)
    {
        switch (op) {
            case '*':
                return a * b;
            case '+':
                return a + b;
            case '-':
                return a - b;                
        }
        assert(0);
    }
     
    ll f0()
    {
        ll res = 0;
        if (*it == '(') {
            ++it;
            res = f2();
            ++it;
        } else {
            while (isdigit(*it)) {
                res *= 10LL;
                res += (ll)(*it - '0');
                ++it;
            }
        }
        return res;
    }
    
    ll f1()
    {
        ll res = f0();
        while (*it == p[0] || *it == p[1]) {
            if (*it == p[0]) {
                ++it;
                res = get_val(res, p[0], f0());                
            } else {                               
                ++it;
                res = get_val(res, p[1], f0());                
            }
        }
        return res;
    }
 
    ll f2()
    {
        ll res = f1();
        while (*it == p[2]) {
            ++it;
            res = get_val(res, p[2], f1());                
        }
        return res;
    }
};

class Calc3 {
    string str;
    vector<char> p;
    string::iterator it;
   
  public:
    Calc3(const string &str, vector<char> p){
        this->str = str;        
        this->p   = p;
        it        = this->str.begin();    
    }
  
    ll get_val(ll a, char op, ll b)
    {
        switch (op) {
            case '*':
                return a * b;
            case '+':
                return a + b;
            case '-':
                return a - b;                
        }
        assert(0);
    }
      
    ll f0()
    {
        ll res = 0;
        if (*it == '(') {
            ++it;
            res = f1();
            ++it;
        } else {
            while (isdigit(*it)) {
                res *= 10LL;
                res += (ll)(*it - '0');
                ++it;
            }
        }
        return res;
    }
   
    ll f1()
    {
        ll res = f0();
        while (*it == p[0] || *it == p[1] || *it == p[2]) {
            if (*it == p[0]) {
                ++it;
                res = get_val(res, p[0], f0());                
            } else if (*it == p[1]) {                               
                ++it;
                res = get_val(res, p[1], f0());                
            } else {
                ++it;
                res = get_val(res, p[2], f0());                
            }
        }
        return res;
    }
};

int main()
{
    string str;
    cin >> str;
    
    vector<char> p = {'*', '+', '-'};

    ll res = LLONG_MIN;    
    do {
        Calc  c(str, p);
        Calc2 c2(str, p);
        Calc22 c22(str, p);
        Calc3 c3(str, p);
        res = max(res, max(max(c.f3(), c2.f2()), max(c22.f2(), c3.f1())));
    } while (next_permutation(p.begin(), p.end()));
    cout << res << endl;    
    return 0;
}

Measured memory_bytes: 3248