#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define loop(i,a,b) for(int i=a;i pii; typedef vector vi; typedef vector vvi; typedef vector vp; typedef vector vvp; typedef vector vs; typedef vector vd; typedef tuple tp; typedef vector vt; typedef vector vvd; typedef pair pip; typedef vectorvip; const double PI=acos(-1); const double EPS=1e-7; const int inf=1e9; const ll INF=1e16; int dx[4]={0,1,0,-1}; int dy[4]={1,0,-1,0}; string s; int a; int func();//+- int num(); int func2();//*/ int func3();//() int num(){ int out=0; while(isdigit(s[a])){ out*=10;out+=s[a]-'0'; a++; } return out; } int func3(){ int out; if(s[a]=='('){ a++; out=func(); a++; }else out=num(); return out; } int func2(){ int out=func3(); while(1){ if(s[a]=='*'){ a++; out*=func3(); }else if(s[a]=='/'){ a++; out/=func3(); }else break; } return out; } int func(){ int out=func2(); while(1){ if(s[a]=='+'){ a++;out+=func2(); }else if(s[a]=='-'){ a++;out-=func2(); }else break; } return out; } int main(){ cin>>s; int n=s.size(); int out=-inf; rep(i,11){ if(!isdigit(s[0])||!isdigit(s[n-1]))continue; a=0; out=max(out,func()); s=s.substr(1)+s[0]; } cout<