#include "bits/stdc++.h"
using namespace std;

#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<(o)<<" ";}
#define dumpl(o) if(DBG){cerr<<#o<<" "<<(o)<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

void cal(int &a, char op, int b) {
	if (op == '+')a += b;
	else if (op == '-')a -= b;
	else if (op == '*')a *= b;
	else assert(1 == 0);
}

class Parser1 {
public:
	using Iter = string::const_iterator;
	Iter it;
	char op1, op2, op3;
	Parser1(Iter it, char op1, char op2, char op3) :it(it), op1(op1), op2(op2), op3(op3) {}
	void cmp(char expected) { if (*it != expected)cerr << *it << " is not " << expected << endl; assert(*it == expected); }
	/*
	op1<op2<op3
	EBNF
	a=b,{op1,b};
	b=c,{op2,c};
	c=d,{op3,d};
	d='(',a,')' | integer;
	*/
	int a() {
		int ret = b();
		while (true) {
			if (*it == op1) {
				it++;
				cal(ret, op1, b());
			}
			else break;
		}
		return ret;
	}
	int b() {
		int ret = c();
		while (true) {
			if (*it == op2) {
				it++;
				cal(ret, op2, c());
			}
			else break;
		}
		return ret;
	}
	int c() {
		int ret = d();
		while (true) {
			if (*it == op3) {
				it++;
				cal(ret, op3, d());
			}
			else break;
		}
		return ret;
	}
	int d() {
		int ret;
		if (*it == '(') {
			it++;
			ret = a();
			cmp(')');
			it++;
		}
		else ret = integer();
		return ret;
	}
	int integer() {
		int ret = 0;
		while (isdigit(*it)) {
			ret *= 10;
			ret += *it - '0';
			it++;
		}
		return ret;
	}
};
class Parser2 {
public:
	using Iter = string::const_iterator;
	Iter it;
	char op1, op2, op3;
	Parser2(Iter it, char op1, char op2, char op3) :it(it), op1(op1), op2(op2), op3(op3) {}
	void cmp(char expected) { if (*it != expected)cerr << *it << " is not " << expected << endl; assert(*it == expected); }
	/*
	op1==op2<op3
	EBNF
	a=b,{(op1|op2),b};
	b=c,{op3,c};
	c='(',a,')' | integer;
	*/
	int a() {
		int ret = b();
		while (true) {
			if (*it == op1) {
				it++;
				cal(ret, op1, b());
			}
			else if (*it == op2) {
				it++;
				cal(ret, op2, b());
			}
			else break;
		}
		return ret;
	}
	int b() {
		int ret = c();
		while (true) {
			if (*it == op3) {
				it++;
				cal(ret, op3, c());
			}
			else break;
		}
		return ret;
	}
	int c() {
		int ret;
		if (*it == '(') {
			it++;
			ret = a();
			cmp(')');
			it++;
		}
		else ret = integer();
		return ret;
	}
	int integer() {
		int ret = 0;
		while (isdigit(*it)) {
			ret *= 10;
			ret += *it - '0';
			it++;
		}
		return ret;
	}
};
class Parser3 {
public:
	using Iter = string::const_iterator;
	Iter it;
	char op1, op2, op3;
	Parser3(Iter it, char op1, char op2, char op3) :it(it), op1(op1), op2(op2), op3(op3) {}
	void cmp(char expected) { if (*it != expected)cerr << *it << " is not " << expected << endl; assert(*it == expected); }
	/*
	op1<op2==op3
	EBNF
	a=b,{op1,b};
	b=c,{(op2|op3),c};
	c='(',a,')' | integer;
	*/
	int a() {
		int ret = b();
		while (true) {
			if (*it == op1) {
				it++;
				cal(ret, op1, b());
			}
			else break;
		}
		return ret;
	}
	int b() {
		int ret = c();
		while (true) {
			if (*it == op3) {
				it++;
				cal(ret, op3, c());
			}
			else if (*it == op2) {
				it++;
				cal(ret, op2, c());
			}
			else break;
		}
		return ret;
	}
	int c() {
		int ret;
		if (*it == '(') {
			it++;
			ret = a();
			cmp(')');
			it++;
		}
		else ret = integer();
		return ret;
	}
	int integer() {
		int ret = 0;
		while (isdigit(*it)) {
			ret *= 10;
			ret += *it - '0';
			it++;
		}
		return ret;
	}
};
class Parser4 {
public:
	using Iter = string::const_iterator;
	Iter it;
	char op1, op2, op3;
	Parser4(Iter it, char op1, char op2, char op3) :it(it), op1(op1), op2(op2), op3(op3) {}
	void cmp(char expected) { if (*it != expected)cerr << *it << " is not " << expected << endl; assert(*it == expected); }
	/*
	op1==op2==op3
	EBNF
	a=b,{(op1|op2|op3),b};
	b='(',a,')' | integer;
	*/
	int a() {
		int ret = b();
		while (true) {
			if (*it == op1) {
				it++;
				cal(ret, op1, b());
			}
			else if (*it == op3) {
				it++;
				cal(ret, op3, b());
			}
			else if (*it == op2) {
				it++;
				cal(ret, op2, b());
			}
			else break;
		}
		return ret;
	}
	int b() {
		int ret;
		if (*it == '(') {
			it++;
			ret = a();
			cmp(')');
			it++;
		}
		else ret = integer();
		return ret;
	}
	int integer() {
		int ret = 0;
		while (isdigit(*it)) {
			ret *= 10;
			ret += *it - '0';
			it++;
		}
		return ret;
	}
};


signed main() {
	string s; getline(cin, s);
	s += "$";
	int ans;
	vector<char> op = { '+','-','*' };
	sort(all(op));
	bool first = true;
	do {
		Parser1 P1(s.begin(), op[0], op[1], op[2]);
		Parser2 P2(s.begin(), op[0], op[1], op[2]);
		Parser3 P3(s.begin(), op[0], op[1], op[2]);
		Parser4 P4(s.begin(), op[0], op[1], op[2]);
		if (first) {
			first = false; ans = max({ P1.a(),P2.a(),P3.a(),P4.a() });
		}
		else ans = max({ ans,P1.a(),P2.a(),P3.a(),P4.a() });
	} while (next_permutation(op.begin(), op.end()));
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3232