#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
struct bnf2{
  string s;
  ll x,n;
  bnf2(){x=0;}
  bnf2(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=factor();
    while(1){
      //cout<<res<<":"<<s[x]<<endl;
      if(s[x]=='+'){
	x++;
	res+=factor();
      }else if(s[x]=='-'){
	x++;
	res-=factor();
      }else if(s[x]=='*'){
	x++;
	res*=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};

struct bnf1{
  string s;
  ll x,n;
  bnf1(){x=0;}
  bnf1(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=term();
      }else if(s[x]=='-'){
	x++;
	res-=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=factor();
    while(1){
      if(s[x]=='*'){
	x++;
	res*=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};
struct bnf3{
  string s;
  ll x,n;
  bnf3(){x=0;}
  bnf3(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=term();
      }else if(s[x]=='*'){
	x++;
	res*=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=factor();
    while(1){
      if(s[x]=='-'){
	x++;
	res-=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};

struct bnf4{
  string s;
  ll x,n;
  bnf4(){x=0;}
  bnf4(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='-'){
	x++;
	res-=term();
      }else if(s[x]=='*'){
	x++;
	res*=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=factor();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};

struct bnf5{
  string s;
  ll x,n;
  bnf5(){x=0;}
  bnf5(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='-'){
	x++;
	res-=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=factor();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=factor();
      }else if(s[x]=='*'){
	x++;
	res*=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};

struct bnf6{
  string s;
  ll x,n;
  bnf6(){x=0;}
  bnf6(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=factor();
    while(1){
      if(s[x]=='-'){
	x++;
	res-=factor();
      }else if(s[x]=='*'){
	x++;
	res*=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};


struct bnf7{
  string s;
  ll x,n;
  bnf7(){x=0;}
  bnf7(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='*'){
	x++;
	res*=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=factor();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=factor();
      }else if(s[x]=='-'){
	x++;
	res-=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};

struct bnf8{
  string s;
  ll x,n;
  bnf8(){x=0;}
  bnf8(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='*'){
	x++;
	res*=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=term2();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=term2();
      }else break;
    }
    return res;
  }
  ll term2(){
    ll res=factor();
    while(1){
      if(s[x]=='-'){
	x++;
	res-=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};

struct bnf9{
  string s;
  ll x,n;
  bnf9(){x=0;}
  bnf9(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='*'){
	x++;
	res*=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=term2();
    while(1){
      if(s[x]=='-'){
	x++;
	res-=term2();
      }else break;
    }
    return res;
  }
  ll term2(){
    ll res=factor();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};


struct bnf10{
  string s;
  ll x,n;
  bnf10(){x=0;}
  bnf10(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=term2();
    while(1){
      if(s[x]=='-'){
	x++;
	res-=term2();
      }else break;
    }
    return res;
  }
  ll term2(){
    ll res=factor();
    while(1){
      if(s[x]=='*'){
	x++;
	res*=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};



struct bnf11{
  string s;
  ll x,n;
  bnf11(){x=0;}
  bnf11(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=term2();
    while(1){
      if(s[x]=='*'){
	x++;
	res*=term2();
      }else break;
    }
    return res;
  }
  ll term2(){
    ll res=factor();
    while(1){
      if(s[x]=='-'){
	x++;
	res-=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};

struct bnf12{
  string s;
  ll x,n;
  bnf12(){x=0;}
  bnf12(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='-'){
	x++;
	res-=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=term2();
    while(1){
      if(s[x]=='*'){
	x++;
	res*=term2();
      }else break;
    }
    return res;
  }
  ll term2(){
    ll res=factor();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};

struct bnf13{
  string s;
  ll x,n;
  bnf13(){x=0;}
  bnf13(string s):s(s){x=0;n=s.size();}
  ll expr(){
    ll res=term();
    while(1){
      if(s[x]=='-'){
	x++;
	res-=term();
      }else break;
    }
    return res;
  }
  ll term(){
    ll res=term2();
    while(1){
      if(s[x]=='+'){
	x++;
	res+=term2();
      }else break;
    }
    return res;
  }
  ll term2(){
    ll res=factor();
    while(1){
      if(s[x]=='*'){
	x++;
	res*=factor();
      }else break;
    }
    return res;
  }
  ll factor(){
    ll res=0;
    if(s[x]=='('){
      x++;
      res=expr();
      x++;
    }else{
      res=number();
    }
    return res;
  }
  ll number(){
    ll res=0;
    while(x<n&&isdigit(s[x])){
      res=res*10+s[x]-'0';
      x++;
    }
    return res;
  }
};

int main(){
  string s;
  cin>>s;
  bnf1 b1(s);
  bnf2 b2(s);
  bnf3 b3(s);
  bnf4 b4(s);
  bnf5 b5(s);
  bnf6 b6(s);
  bnf7 b7(s);
  bnf8 b8(s);
  bnf9 b9(s);
  bnf10 b10(s);
  bnf11 b11(s);
  bnf12 b12(s);
  bnf13 b13(s);
  ll ans=b1.expr();
  ans=max(ans,b2.expr());
  ans=max(ans,b3.expr());
  ans=max(ans,b4.expr());
  ans=max(ans,b5.expr());
  ans=max(ans,b6.expr());
  ans=max(ans,b7.expr());
  ans=max(ans,b8.expr());
  ans=max(ans,b9.expr());
  ans=max(ans,b10.expr());
  ans=max(ans,b11.expr());
  ans=max(ans,b12.expr());
  ans=max(ans,b13.expr());
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3264