#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

enum Type{
	Plus,
	Minus,
	Mult,
};

int loc[128];

ll calc_two_same(char line[202],int rank[3],int maximum){

	ll tmp,op1,work,count,work2;
	char calc;
	stack<ll> NUM,work_num;
	stack<char> OP,work_op;

	bool numFLG,negFLG;

	tmp = 0;
	numFLG = false;
	negFLG = false;


	for(int k = 0; line[k] != '\0'; k++){
		if(line[k] >= '0' && line[k] <= '9'){
			numFLG = true;
			tmp = 10*tmp + (line[k] - '0');

		}else{

			if(numFLG == true){

				if(negFLG){
					tmp = -1*tmp;
					negFLG = false;
				}

				if(OP.empty() == false && OP.top() != '('&& rank[loc[OP.top()]] == maximum){
					calc = OP.top();
					OP.pop();
					op1 = NUM.top();
					NUM.pop();

					if(calc == '*'){
						NUM.push(tmp*op1);
					}else if(calc == '+'){
						NUM.push(op1+tmp);
					}else{ //calc == '-'
						NUM.push(op1-tmp);
					}
				}else{
					NUM.push(tmp);
				}

				numFLG = false;
				tmp = 0;
			}

			if(line[k] == '+' ||line[k] == '*'){
				OP.push(line[k]);
			}else if(line[k] == '('){
				if(line[k-1] == '('){
					NUM.push(1);
					OP.push('*');
					OP.push('(');
				}else{
					OP.push('(');
				}
			}else if(line[k] == '-'){

				if(k == 0){
					if(line[k+1] != '('){
						negFLG = true;
					}else{
						NUM.push(-1);
						OP.push('*');
					}
				}else if(line[k-1] == '(' && line[k+1] == '('){
					NUM.push(-1);
					OP.push('*');
				}else if(k > 0 && (line[k-1] == '+' || line[k-1] == '-' || line[k-1] == '*' || line[k-1] == '(')){
					negFLG = true;
				}else{
					OP.push('-');
				}
			}else if(line[k] == ')'){

				work = NUM.top();
				NUM.pop();
				work_num.push(work);

				count = 0;

				while(true){
					calc = OP.top();
					OP.pop();
					if(calc == '(')break;

					count++;

					work_op.push(calc);

					work = NUM.top();
					NUM.pop();
					work_num.push(work);
				}

				if(count == 0){
					work = work_num.top();
					work_num.pop();
				}else{

					work = work_num.top();
					work_num.pop();

					while(!work_num.empty()){
						calc = work_op.top();
						work_op.pop();

						if(calc == '+'){
							work += work_num.top();
						}else if(calc == '-'){
							work -= work_num.top();
						}else if(calc == '*'){
							work *= work_num.top();
						}
						work_num.pop();
					}
				}

				if(OP.empty() == false && rank[loc[OP.top()]] == maximum){
					calc = OP.top();
					OP.pop();
					work2 = NUM.top();
					NUM.pop();
					switch(calc){
					case '+':
						work += work2;
						break;
					case '-':
						work = work2-work;
						break;
					case '*':
						work *= work2;
						break;
					}
				}

				NUM.push(work);

			}else{	//line[k] == '='

				work = NUM.top();
				NUM.pop();
				work_num.push(work);

				while(!NUM.empty()){
					calc = OP.top();
					OP.pop();

					work_op.push(calc);

					work = NUM.top();
					NUM.pop();
					work_num.push(work);
				}

				work = work_num.top();
				work_num.pop();

				while(!work_num.empty()){
					calc = work_op.top();
					work_op.pop();

					if(calc == '+'){
						work += work_num.top();
					}else if(calc == '-'){
						work -= work_num.top();
					}else if(calc == '*'){
						work *= work_num.top();
					}
					work_num.pop();
				}

				return work;
			}
		}
	}
	return -1;
}


ll calc_three_same(char line[202]){

	ll tmp,op1,work,count,work2;
	char calc;
	stack<ll> NUM,work_num;
	stack<char> OP,work_op;

	bool numFLG;

	tmp = 0;
	numFLG = false;

	for(int k = 0; line[k] != '\0'; k++){
		if(line[k] >= '0' && line[k] <= '9'){
			numFLG = true;
			tmp = 10*tmp + (line[k] - '0');

		}else{

			if(numFLG == true){

				if(OP.empty() == false && OP.top() != '('){
					calc = OP.top();
					OP.pop();
					op1 = NUM.top();
					NUM.pop();

					if(calc == '*'){
						NUM.push(tmp*op1);
					}else if(calc == '+'){
						NUM.push(op1+tmp);
					}else{ //calc == '-'
						NUM.push(op1-tmp);
					}
				}else{
					NUM.push(tmp);
				}

				numFLG = false;
				tmp = 0;
			}

			if(line[k] == '+' ||line[k] == '*'){
				OP.push(line[k]);
			}else if(line[k] == '('){
				if(line[k-1] == '('){
					NUM.push(1);
					OP.push('*');
					OP.push('(');
				}else{
					OP.push('(');
				}
			}else if(line[k] == '-'){

				if(k == 0){
					NUM.push(-1);
					OP.push('*');
				}else if(line[k-1] == '(' && line[k+1] == '('){
					NUM.push(-1);
					OP.push('*');
				}else{
					OP.push('-');
				}
			}else if(line[k] == ')'){

				work = NUM.top();
				NUM.pop();
				work_num.push(work);

				count = 0;

				while(true){
					calc = OP.top();
					OP.pop();
					if(calc == '(')break;

					count++;

					work_op.push(calc);

					work = NUM.top();
					NUM.pop();
					work_num.push(work);
				}

				if(count == 0){
					work = work_num.top();
					work_num.pop();
				}else{

					work = work_num.top();
					work_num.pop();

					while(!work_num.empty()){
						calc = work_op.top();
						work_op.pop();

						if(calc == '+'){
							work += work_num.top();
						}else if(calc == '-'){
							work -= work_num.top();
						}else if(calc == '*'){
							work *= work_num.top();
						}
						work_num.pop();
					}
				}

				if(OP.empty() == false){
					calc = OP.top();
					OP.pop();
					work2 = NUM.top();
					NUM.pop();
					switch(calc){
					case '+':
						work += work2;
						break;
					case '-':
						work = work2-work;
						break;
					case '*':
						work *= work2;
						break;
					}
				}

				NUM.push(work);

			}else{	//line[k] == '='

				work = NUM.top();
				NUM.pop();
				work_num.push(work);

				while(!NUM.empty()){
					calc = OP.top();
					OP.pop();

					work_op.push(calc);

					work = NUM.top();
					NUM.pop();
					work_num.push(work);
				}

				work = work_num.top();
				work_num.pop();

				while(!work_num.empty()){
					calc = work_op.top();
					work_op.pop();

					if(calc == '+'){
						work += work_num.top();
					}else if(calc == '-'){
						work -= work_num.top();
					}else if(calc == '*'){
						work *= work_num.top();
					}
					work_num.pop();
				}

				return work;
			}
		}
	}
	return -1;
}

ll calc_all_different(char line[202],int rank[3],int maximum){

	int work_line_length,work_rank[3];
	ll tmp,op1,work,count,work2,work_tmp;
	char calc,work_line[202];
	stack<ll> NUM,work_num;
	stack<ll> to_make_work;
	queue<ll> work_num2;
	stack<char> OP,work_op;
	queue<char> work_op2;

	bool numFLG;

	tmp = 0;
	numFLG = false;

	for(int k = 0; line[k] != '\0'; k++){
		if(line[k] >= '0' && line[k] <= '9'){
			numFLG = true;
			tmp = 10*tmp + (line[k] - '0');

		}else{ //??°?????§????????´???

			if(numFLG == true){

				if(OP.empty() == false && OP.top() != '(' && rank[loc[OP.top()]] == maximum){
					calc = OP.top();
					OP.pop();
					op1 = NUM.top();
					NUM.pop();

					if(calc == '*'){
						NUM.push(tmp*op1);
					}else if(calc == '+'){
						NUM.push(op1+tmp);
					}else{ //calc == '-'
						NUM.push(op1-tmp);
					}
				}else{
					NUM.push(tmp);
				}

				numFLG = false;
				tmp = 0;
			}

			if(line[k] == '+' ||line[k] == '*'){
					OP.push(line[k]);
			}else if(line[k] == '('){
				if(line[k-1] == '('){
					NUM.push(1);
					OP.push('*');
					OP.push('(');
				}else{
					OP.push('(');
				}
			}else if(line[k] == '-'){

				if(k == 0){
					NUM.push(-1);
					OP.push('*');
				}else if(line[k-1] == '(' && line[k+1] == '('){
					NUM.push(-1);
					OP.push('*');
				}else{
					OP.push('-');
				}
			}else if(line[k] == ')'){

				work = NUM.top();
				NUM.pop();
				work_num.push(work);

				count = 0;

				while(true){
					calc = OP.top();
					OP.pop();
					if(calc == '(')break;

					count++;

					work_op.push(calc);

					work = NUM.top();
					NUM.pop();
					work_num.push(work);
				}

				if(count == 0){
					work = work_num.top();
					work_num.pop();
				}else{

					work_line_length = 0;

					while(!work_num.empty()){

						work_tmp = work_num.top();
						if(work_tmp < 0){
							work_line[work_line_length++] = '-';
							work_tmp *= -1;
						}
						int S = 10;
						for(int a = 0; ;a++){
							to_make_work.push(work_tmp%S);
							if(S > work_tmp)break;
							else{
								work_tmp /= S;
							}
						}

						while(!to_make_work.empty()){
							work_line[work_line_length++] = '0' + to_make_work.top();
							to_make_work.pop();
						}

						work_num.pop();
						if(!work_op.empty()){
							work_line[work_line_length++] = work_op.top();
							work_op.pop();
						}
					}

					work_line[work_line_length] = '=';
					work_line[work_line_length+1] = '\0';

					if(rank[0] == 2){
						work_rank[0] = 0;
						work_rank[1] = rank[1];
						work_rank[2] = rank[2];

						work = calc_two_same(work_line,work_rank,1);
					}else if(rank[1] == 2){
						work_rank[0] = rank[0];
						work_rank[1] = 0;
						work_rank[2] = rank[2];

						work = calc_two_same(work_line,work_rank,1);
					}else{ //rank[2] == 2
						work_rank[0] = rank[0];
						work_rank[1] = rank[1];
						work_rank[2] = 0;

						work = calc_two_same(work_line,work_rank,1);
					}

				}

				if(OP.empty() == false && rank[loc[OP.top()]] == maximum){
					calc = OP.top();
					OP.pop();
					work2 = NUM.top();
					NUM.pop();
					switch(calc){
					case '+':
						work += work2;
						break;
					case '-':
						work = work2-work;
						break;
					case '*':
						work *= work2;
						break;
					}
				}

				NUM.push(work);

			}else{	//line[k] == '='

				work = NUM.top();
				NUM.pop();
				work_num.push(work);

				while(!NUM.empty()){
					calc = OP.top();
					OP.pop();

					work_op.push(calc);

					work = NUM.top();
					NUM.pop();
					work_num.push(work);
				}

				work_line_length = 0;

				while(!work_num.empty()){

					work_tmp = work_num.top();
					if(work_tmp < 0){
						work_line[work_line_length++] = '-';
						work_tmp *= -1;
					}
					int S = 10;
					for(int a = 0; ;a++){
						to_make_work.push(work_tmp%S);
						if(S > work_tmp)break;
						else{
							work_tmp /= S;
						}
					}

					while(!to_make_work.empty()){
						work_line[work_line_length++] = '0' + to_make_work.top();
						to_make_work.pop();
					}

					work_num.pop();
					if(!work_op.empty()){
						work_line[work_line_length++] = work_op.top();
						work_op.pop();
					}
				}

				work_line[work_line_length] = '=';
				work_line[work_line_length+1] = '\0';

				if(rank[0] == 2){
					work_rank[0] = 0;
					work_rank[1] = rank[1];
					work_rank[2] = rank[2];

					work = calc_two_same(work_line,work_rank,1);
				}else if(rank[1] == 2){
					work_rank[0] = rank[0];
					work_rank[1] = 0;
					work_rank[2] = rank[2];

					work = calc_two_same(work_line,work_rank,1);
				}else{ //rank[2] == 2
					work_rank[0] = rank[0];
					work_rank[1] = rank[1];
					work_rank[2] = 0;

					work = calc_two_same(work_line,work_rank,1);
				}

			return work;
			}
		}
	}
	return -1;
}

int main(){

	int maximum;
	loc['+'] = 0;
	loc['-'] = 1;
	loc['*'] = 2;

	char line[202];
	int length;

	int appear_num[128];
	appear_num['+'] = 0;
	appear_num['-'] = 0;
	appear_num['*'] = 0;

	scanf("%s",line);
	for(length = 0; line[length] != '\0';length++){
		if(line[length] == '+'){
			appear_num['+']++;
		}else if(line[length] == '-'){
			appear_num['-']++;
		}else if(line[length] == '*'){
			appear_num['*']++;
		}
	}

	//(24-((2130*1)-3)+2*37)-(((0+11)+28+3+1)*((0*1)-((2+457)-2-237)+0-1+(1532-(36-0))-((3*0)-1)))
	//71611

	line[length] = '=';
	line[length+1] = '\0';

	int rank[3],num[3];
	ll ans = -9223372036854775808,tmp_ans;

	if(appear_num['+'] > 0 && appear_num['-'] > 0 && appear_num['*'] > 0){
		for(int a = 0; a <= 2; a++){
			for(int b = 0; b <= 2; b++){
				for(int c = 0; c <= 2; c++){

					for(int i = 0; i < 3; i++)num[i] = 0;

					rank[Plus] = a;
					rank[Minus] = b;
					rank[Mult] = c;

					maximum = -1;
					maximum = max(a,max(b,c));

					num[a]++;
					num[b]++;
					num[c]++;

					if(a != b && a != c && b != c){
						tmp_ans = calc_all_different(line,rank,maximum);
					}else if(num[0] == 3 || num[1] == 3 || num[2] == 3){
						tmp_ans = calc_three_same(line);
					}else{
						tmp_ans = calc_two_same(line,rank,maximum);
					}
					ans = max(ans,tmp_ans);
				}
			}
		}
	}else if(appear_num['+'] == 0 && appear_num['-'] > 0 && appear_num['*'] > 0){

		tmp_ans = calc_three_same(line);
		ans = max(ans,tmp_ans);
		rank[Plus] = 0;
		rank[Minus] = 0;
		rank[Mult] = 1;
		tmp_ans = calc_two_same(line,rank,1);
		ans = max(ans,tmp_ans);

		rank[Plus] = 0;
		rank[Minus] = 1;
		rank[Mult] = 0;
		tmp_ans = calc_two_same(line,rank,1);
		ans = max(ans,tmp_ans);

	}else if(appear_num['+'] > 0 && appear_num['-'] == 0 && appear_num['*'] > 0){

		tmp_ans = calc_three_same(line);
		ans = max(ans,tmp_ans);
		rank[Plus] = 0;
		rank[Minus] = 0;
		rank[Mult] = 1;
		tmp_ans = calc_two_same(line,rank,1);
		ans = max(ans,tmp_ans);

		rank[Plus] = 1;
		rank[Minus] = 0;
		rank[Mult] = 0;
		tmp_ans = calc_two_same(line,rank,1);
		ans = max(ans,tmp_ans);

	}else if(appear_num['+'] > 0 && appear_num['-'] > 0 && appear_num['*'] == 0){

		tmp_ans = calc_three_same(line);
		ans = max(ans,tmp_ans);
		rank[Plus] = 0;
		rank[Minus] = 1;
		rank[Mult] = 0;
		tmp_ans = calc_two_same(line,rank,1);
		ans = max(ans,tmp_ans);

		rank[Plus] = 1;
		rank[Minus] = 0;
		rank[Mult] = 0;
		tmp_ans = calc_two_same(line,rank,1);
		ans = max(ans,tmp_ans);

	}else{
		tmp_ans = calc_three_same(line);
		ans = max(ans,tmp_ans);
	}

	printf("%lld\n",ans);

	return 0;
}

Measured memory_bytes: 3268