#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>

#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long>vll;
typedef pair<int,int> pi;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

#define int long long

typedef string::const_iterator State;

int number(State &begin);
int factor(State &begin);
int expression1(State &begin);
int expression2(State &begin);
int expression3(State &begin);

vector<int> priority(3);

int number(State &begin){
  int ret=0;
  while(isdigit(*begin)){
    ret*=10;
    ret+=(*begin)-'0';
    begin++;
  }
  // cout<<"number: "<<ret<<endl;
  return ret;
}

int factor(State &begin){
  // cout<<"in factor: "<<*begin<<endl;
  int ret;
  if(*begin=='('){
    begin++;
    ret=expression1(begin);
    begin++;
  }else{
    // cout<<"factor in number" <<endl;
    ret=number(begin);
  }
  return ret;
}

int expression3(State &begin){
  // cout<<"in expr3: "<<endl;
  int ret=factor(begin);
  while(1){
    if(*begin=='+'&&priority[2]&(1<<0)){
      begin++;
      ret+=factor(begin);
    }else if(*begin=='-'&&priority[2]&(1<<1)){
      begin++;
      ret-=factor(begin);
    }else if(*begin=='*'&&priority[2]&(1<<2)){
      begin++;
      ret*=factor(begin);
    }else{
      break;
    }
  }
  return ret;
}

int expression2(State &begin){
  int ret=expression3(begin);
  // cout<<"in expr2: "<<endl;
  while(1){
    if(*begin=='+'&&priority[1]&(1<<0)){
      begin++;
      ret+=expression3(begin);
    }else if(*begin=='-'&&priority[1]&(1<<1)){
      begin++;
      ret-=expression3(begin);
    }else if(*begin=='*'&&priority[1]&(1<<2)){
      begin++;
      ret*=expression3(begin);
    }else{
      break;
    }
  }
  return ret;
}

int expression1(State &begin){
  int ret=expression2(begin);
  // cout<<"in expr1: "<<endl;
  while(1){
    if(*begin=='+'&&priority[0]&(1<<0)){
      begin++;
      ret+=expression2(begin);
    }else if(*begin=='-'&&priority[0]&(1<<1)){
      begin++;
      ret-=expression2(begin);
    }else if(*begin=='*'&&priority[0]&(1<<2)){
      begin++;
      ret*=expression2(begin);
    }else{
      break;
    }
  }
  return ret;
}

signed main(){
  string s;
  cin>>s;
  int ans=LLONG_MIN;
  for(int i=0;i<(1<<3);i++){
    for(int j=0;j<(1<<3);j++){
      for(int k=0;k<(1<<3);k++){
    if((i|j|k)!=7)continue;
    priority[0]=i;priority[1]=j;priority[2]=k;
    State begin=s.begin();
        //cout<<i<<" "<<j<<" "<<k<<": "<<expression1(begin)<<endl;
    ans=max(ans,expression1(begin));
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 3224