#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
#define INF 0x7FFFFFFFFFFFFFFF
#define ll long long

struct www_t{
  long long re;
  int j;
};

ll judge(www_t res);
ll exprALl();
ll expr1();
ll expr2();
ll expr3();
ll term1();
ll term2();
ll term3();
ll fac();
int left();
char peek();
char pop();
int isdeg(char z);
int isdeg(char z);
void eat(char z);
ll num();

string s;
int t;

vector<vector<int> > order={{1,1,1},{1,1,2},{1,2,2},{1,2,1},{1,2,3},{1,3,2},{2,1,1},{2,2,1},{2,1,2},{2,1,3},{2,3,1},{3,1,2},{3,2,1}};
vector<int> a;

int main(){
  cin >> s;
  long long ans=0-INF;
  for(int k=0;k<(int)order.size();k++){
    a=order[k];
    long long an;
    t=0;
    www_t z;
    z.re=0;
    z.j=0;
    an=judge(z);
    ans=max(ans,an);
  }
  cout << ans << endl;
}

ll judge(www_t res){
  if(a[0]==a[1]&&a[1]==a[2]){
    if(res.j==0) return exprALl();
    else if(res.j==1) return fac();
  }
  else if(a[0]==a[1]){
    if(a[0]==1){
      if(res.j==0) return term3();
      else if(res.j==7) return expr1();
      else if(res.j==2) return fac();
    }
    else if(a[2]==1){
      if(res.j==0) return expr1();
      else if(res.j==2) return term3();
      else if(res.j==7) return fac();
    }
  }
  else if(a[1]==a[2]){
    if(a[1]==1){
      if(res.j==0) return term1();
      else if(res.j==5) return expr2();
      else if(res.j==3) return fac();
    }
    else if(a[0]==1){
      if(res.j==0) return expr2();
      else if(res.j==3) return term1();
      else if(res.j==5) return fac();
    }
  }
  else if(a[2]==a[0]){
    if(a[0]==1){
      if(res.j==0) return term2();
      else if(res.j==6) return expr3();
      else if(res.j==4) return fac();
    }
    else if(a[1]==1){
      if(res.j==0) return expr3();
      else if(res.j==4) return term2();
      else if(res.j==6) return fac();
    }
  }
  else{
    if(a[0]==1&&a[1]==2&&a[2]==3){
      if(res.j==0) return term3();
      else if(res.j==7) return term2();
      else if(res.j==6) return term1();
      else if(res.j==5) return fac();
    }
    else if(a[0]==1&&a[1]==3&&a[2]==2){
      if(res.j==0) return term2();
      else if(res.j==6) return term3();
      else if(res.j==7) return term1();
      else if(res.j==5) return fac();
    }
    else if(a[0]==2&&a[1]==1&&a[2]==3){
      if(res.j==0) return term3();
      else if(res.j==7) return term1();
      else if(res.j==5) return term2();
      else if(res.j==6) return fac();
    }
    else if(a[0]==2&&a[1]==3&&a[2]==1){
      if(res.j==0) return term2();
      else if(res.j==6) return term1();
      else if(res.j==5) return term3();
      else if(res.j==7) return fac();
    }
    else if(a[0]==3&&a[1]==1&&a[2]==2){
      if(res.j==0) return term1();
      else if(res.j==5) return term3();
      else if(res.j==7) return term2();
      else if(res.j==6) return fac();
    }
    else if(a[0]==3&&a[1]==2&&a[2]==1){
      if(res.j==0) return term1();
      else if(res.j==5) return term2();
      else if(res.j==6) return term3();
      else if(res.j==7) return fac();
    }
  }
  cout << "warning " << t << endl;
  return 0;
}

ll exprALl(){
  www_t res;
  res.j=1;
  res.re=judge(res);
  while(left()&&(peek()=='+'||peek()=='-'||peek()=='*')){
    if(peek()=='+'){
      eat('+');
      res.re+=judge(res);
    }
    else if(peek()=='-'){
      eat('-');
      res.re-=judge(res);
    }
    else if(peek()=='*'){
      eat('*');
      res.re*=judge(res);
    }
  }
  return res.re;
}

ll expr1(){
  www_t res;
  res.j=2;
  res.re=judge(res);
  while(left()&&(peek()=='+'||peek()=='-')){
    if(peek()=='+'){
      eat('+');
      res.re+=judge(res);
    }
    else if(peek()=='-'){
      eat('-');
      res.re-=judge(res);
    }
  }
  return res.re;
}

ll expr2(){
  www_t res;
  res.j=3;
  res.re=judge(res);
  while(left()&&(peek()=='-'||peek()=='*')){
    if(peek()=='-'){
      eat('-');
      res.re-=judge(res);
    }
    else if(peek()=='*'){
      eat('*');
      res.re*=judge(res);
    }
  }
  return res.re;
}

ll expr3(){
  www_t res;
  res.j=4;
  res.re=judge(res);
  while(left()&&(peek()=='*'||peek()=='+')){
    if(peek()=='*'){
      eat('*');
      res.re*=judge(res);
    }
    else if(peek()=='+'){
      eat('+');
      res.re+=judge(res);
    }
  }
  return res.re;
}

ll term1(){
  www_t res;
  res.j=5;
  res.re=judge(res);
  while(left()&&(peek()=='+')){
    if(peek()=='+'){
      eat('+');
      res.re+=judge(res);
    }
  }
  return res.re;
}

ll term2(){
  www_t res;
  res.j=6;
  res.re=judge(res);
  while(left()&&(peek()=='-')){
    if(peek()=='-'){
      eat('-');
      res.re-=judge(res);
    }
  }
  return res.re;
}

ll term3(){
  www_t res;
  res.j=7;
  res.re=judge(res);
  while(left()&&(peek()=='*')){
    if(peek()=='*'){
      eat('*');
      res.re*=judge(res);
    }
  }
  return res.re;
}

ll fac(){
  www_t res;
  res.j=0;
  if(peek()=='('){
    eat('(');
    res.re=judge(res);
    eat(')');
    return res.re;
  }
  else{
    res.re=num();
    return res.re;
  }
}


int left(){                 //まだ文字列が残っているかを調べる
  return int(s.size())>t;
}

char peek(){                //次の文字を一文字先読みする
  return s[t];
}

char pop(){                 //次の文字を読みとって、インデックスを進める
  t++;
  return s[t-1];
}

int isdeg(char z){
  return z>='0'&&z<='9';
}

void eat(char z){
  if(s[t]!=z) cout << "warning " << t << endl;
  t++;
}

ll num(){
  ll res=0;
  while(left()&&isdeg(peek())){
    res*=10;
    res+=pop()-'0';
  }
  return res;
}



Measured memory_bytes: 3232