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

string y[3],s;
int p;
long long f(int x){
	if( x == 3 ){
		if( s[p] == '(' ){
			p++;
			long long ans = f(0);
			p++;
			return ans;
		}else{
			long long ans = 0;
			while( s[p] >= '0' && s[p] <= '9' )
				ans = ans * 10 + s[p++] - '0';
			return ans;
		}
	}else{
		long long ans = f(x+1);
		while( y[x].find(s[p]) != -1 ){
			if( s[p] == '+' ){
				p++;
				ans += f(x+1);
			}else if( s[p] == '-' ){
				p++;
				ans -= f(x+1);
			}else if( s[p] == '*' ){
				p++;
				ans *= f(x+1);
			}
		}
		return ans;
	}
}
int main(){
	cin >> s;
	s += "~";
	long long ans;
	int fl = 0;
	for(int i = 0 ; i < 3 ; i++){
		for(int j = 0 ; j < 3 ; j++){
			for(int k = 0 ; k < 3 ; k++){
				y[0] = y[1] = y[2] = "";
				y[i] += "+";
				y[j] += "-";
				y[k] += "*";
				p = 0;
				if(!fl){
					ans = f(0);
					fl =1;
				}else ans = max(ans,f(0));
			}
		}
	}
	cout << ans << endl;
}