//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

typedef string::const_iterator State;
class ParseError {};
int expression(State&);
int expressionB(State&);
int expressionC(State&);
int expressionD(State&);
int term(State&);
int term2(State&);
int number(State&);
int factor(State&);

char op[3] = {'+', '-', '*'};
int expression(State &begin) {
	int ret = term(begin);
	while(1) {
		if(*begin == op[0]) {
			begin++;
			if(op[0] == '+') ret += term(begin);
			else if(op[0] == '-') ret -= term(begin);
			else if(op[0] == '*') ret *= term(begin);
		} else {
			break;
		}
	}
	return ret;
}

int factorB(State &begin) {
	if(*begin == '(') {
		begin++;
		int ret = expressionB(begin);
		begin++;
		return ret;
	} else {
		return number(begin);
	}
}

int termB(State &begin) {
	int ret = factorB(begin);
	while(1) {
		//cout << "term:" << *begin << endl;
		if(*begin == op[1]) {
			begin++;
			if(op[1] == '+') ret += factorB(begin);
			else if(op[1] == '-') ret -= factorB(begin);
			else if(op[1] == '*') ret *= factorB(begin);
		} else if(*begin == op[2]) {
			begin++;
			if(op[2] == '+') ret += factorB(begin);
			else if(op[2] == '-') ret -= factorB(begin);
			else if(op[2] == '*') ret *= factorB(begin);
		} else {
			break;
		}
	}
	//cout << "tret:" << ret << endl;
	return ret;
}

int expressionB(State &begin) {
	int ret = termB(begin);
	while(1) {
		//cout << *begin << endl;
		if(*begin == op[0]) {
			begin++;
			if(op[0] == '+') ret += termB(begin);
			else if(op[0] == '-') ret -= termB(begin);
			else if(op[0] == '*') ret *= termB(begin);
		} else {
			break;
		}
	}
	//cout << "ret:" << ret << endl;
	return ret;
}

int factorD(State &begin) {
	if(*begin == '(') {
		begin++;
		int ret = expressionD(begin);
		begin++;
		return ret;
	} else {
		return number(begin);
	}
}

int termD(State &begin) {
	int ret = factorD(begin);
	while(1) {
		if(*begin == op[0]) {
			begin++;
			if(op[0] == '+') ret += factorD(begin);
			else if(op[0] == '-') ret -= factorD(begin);
			else if(op[0] == '*') ret *= factorD(begin);
		} else {
			break;
		}
	}
	return ret;
}

int expressionD(State &begin) {
	int ret = termD(begin);
	while(1) {
		if(*begin == op[1]) {
			begin++;
			if(op[1] == '+') ret += termD(begin);
			else if(op[1] == '-') ret -= termD(begin);
			else if(op[1] == '*') ret *= termD(begin);
		} else if(*begin == op[2]) {
			begin++;
			if(op[2] == '+') ret += termD(begin);
			else if(op[2] == '-') ret -= termD(begin);
			else if(op[2] == '*') ret *= termD(begin);
		} else {
			break;
		}
	}
	return ret;
}

int factorC(State &begin) {
	if(*begin == '(') {
		begin++;
		int ret = expressionC(begin);
		begin++;
		return ret;
	} else {
		return number(begin);
	}
}

int expressionC(State &begin) {
	int ret = factorC(begin);
	while(1) {
		if(*begin == op[0]) {
			begin++;
			if(op[0] == '+') ret += factorC(begin);
			else if(op[0] == '-') ret -= factorC(begin);
			else if(op[0] == '*') ret *= factorC(begin);
		} else if(*begin == op[1]) {
			begin++;
			if(op[1] == '+') ret += factorC(begin);
			else if(op[1] == '-') ret -= factorC(begin);
			else if(op[1] == '*') ret *= factorC(begin);
		} else if(*begin == op[2]) {
			begin++;
			if(op[2] == '+') ret += factorC(begin);
			else if(op[2] == '-') ret -= factorC(begin);
			else if(op[2] == '*') ret *= factorC(begin);
		} else {
			break;
		}
	}
	return ret;
}

int term(State &begin) {
	int ret = term2(begin);
	while(1) {
		if(*begin == op[1]) {
			begin++;
			if(op[1] == '+') ret += term2(begin);
			else if(op[1] == '-') ret -= term2(begin);
			else if(op[1] == '*') ret *= term2(begin);
		} else {
			break;
		}
	}
	return ret;
}

int term2(State &begin) {
	int ret = factor(begin);
	while(1) {
		if(*begin == op[2]) {
			begin++;
			if(op[2] == '+') ret += factor(begin);
			else if(op[2] == '-') ret -= factor(begin);
			else if(op[2] == '*') ret *= factor(begin);
		} else {
			break;
		}
	}
	return ret;
}

int factor(State &begin) {
	if(*begin == '(') {
		begin++;
		int ret = expression(begin);
		begin++;
		return ret;
	} else {
		return number(begin);
	}
}

int number(State &begin) {
	int ret = 0;
	while(isdigit(*begin)) {
		ret *= 10;
		ret += *begin - '0';
		begin++;
	}
	return ret;
}

signed main(void)
{
	string s;
	getline(cin, s);

	State begin = s.begin();
	int ret = expressionC(begin);
	//REP(i, 3) cout << op[i] << " ";
	//cout << ret << endl;

	sort(op, op+3);
	do {
		State begin = s.begin();
		int ans = expression(begin);
		ret = max(ret, ans);
		//REP(i, 3) cout << op[i] << " ";
		//cout << ret << " " << ans << endl;
	} while(next_permutation(op, op+3));

	sort(op, op+3);
	//cout << "A" << endl;
	do {
		State begin = s.begin();
		int ans = expressionB(begin);
		ret = max(ret, ans);
		//REP(i, 3) cout << op[i] << " ";
		//cout << ret << " " << ans << endl;
	} while(next_permutation(op, op+3));

	sort(op, op+3);
	//cout << "A" << endl;
	do {
		State begin = s.begin();
		int ans = expressionD(begin);
		ret = max(ret, ans);
		//REP(i, 3) cout << op[i] << " ";
		//cout << ret << " " << ans << endl;
	} while(next_permutation(op, op+3));

	cout << ret << endl;

	return 0;
}

Measured memory_bytes: 3192