#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<limits>

using namespace std;

#define int long long

vector<int> x(3);

/*
numer 0
( 1
) 2
+ 3
- 4
* 5
*/

char temp[] = {'n', '(', ')', '+', '-', '*'};

int solve(vector<pair<int,int>> t, int b, int e){
	vector<pair<int,int>> t2;
	
	for(int i = b, depth = 0, index = -1; i < e; i++){
		switch(t[i].first) {
			case 1: 
				if(depth == 0) {
					index = i;
				}
				depth++;
				break;
			case 2:
				depth--; 
				if(depth == 0) {
					t2.push_back({0, solve(t, index+1, i)});
				}
				break;
			default: if(!depth) t2.push_back(t[i]);
		}
	}
	for(int k = 0; k < 3; k++) {
	
		vector<pair<int,int>> st;
		
		for(int i = 0, depth = 0, index = -1; i < t2.size(); i++){
			st.push_back(t2[i]);
			pair<int,int> a, b, c;
			
			while(st.size() >= 3) {
				a = st.back(); st.pop_back();
				b = st.back(); st.pop_back();
				c = st.back(); st.pop_back();
				
				if(!b.first){
					st.push_back(c);
					st.push_back(b);
					st.push_back(a);
					break;
				}
				
				if(b.first == 3) {
					if(x[0] == k) {
						st.push_back({0,c.second + a.second});
					} else {
						st.push_back(c);
						st.push_back(b);
						st.push_back(a);
						break;
					}
				}
				
				if(b.first == 4) {
					if(x[1] == k) {
						st.push_back({0,c.second - a.second});
					} else {
						st.push_back(c);
						st.push_back(b);
						st.push_back(a);
						break;
					}
				}
				
				if(b.first == 5) {
					if(x[2] == k) {
						st.push_back({0,c.second * a.second});
					} else {
						st.push_back(c);
						st.push_back(b);
						st.push_back(a);
						break;
					}
				} 
			}
		}
		
		if(k == 2) {
			return st.back().second;
		} else {
			t2 = st;
		}
	}
	
	return 0;
}

void hoge(string &s, vector<pair<int,int>> &t){
	
	for(int i = 0, num = 0; i < s.size(); i++){
		switch(s[i]) {
			case '(': t.push_back({1,0}); break;
			case ')': t.push_back({2,0}); break;
			case '+': t.push_back({3,0}); break;
			case '-': t.push_back({4,0}); break;
			case '*': t.push_back({5,0}); break;
			default : 
				num = num * 10 + s[i] - '0';
				if(i + 1 == s.size() || '0' > s[i+1] && s[i+1]){
					t.push_back({0,num});
					num = 0;
				}
		}
	}
}

signed main(){
	
	vector<pair<int,int>> t;
	string s;
	
	int ans =  numeric_limits<long long>::min();
	
	cin>>s;
	
	hoge(s, t);
	
	
	for(int i = 0; i < 3; i++){
		for(int j = 0; j < 3; j++){
			for(int k = 0; k < 3; k++){
				x[0] = i;
				x[1] = j;
				x[2] = k;
				ans = max(solve(t, 0, t.size()), ans);
			}
		}
	}
	
	cout<<ans<<endl;
}
