#define SMAX 100005
#include <ctype.h>
#include <stdio.h>
int t;
char str[SMAX];
int eval(){
int f=0;
while(isdigit(str[t])){
f=f*10+str[t]-'0';
++t;
}
return f;
}
int exp(){
int f=term();
while(str[t]=='+' || str[t]=='-'){
++t;
if(str[t-1]=='+')
f+=term();
else if(str[t-1]=='-')
f-=term();
}
return f;
}
int term(){
int f=fact();
while(str[t]=='*' || str[t]=='/'){
++t;
if(str[t-1]=='*')
f*=term();
else if(str[t-1]=='/')
f/=term();
}
return f;
}
int fact(){
int f;
if(str[t]=='('){
++t;
f=exp();
++t;
}
else{
f=eval();
}
return f;
}
int main(){
freopen("evaluare.in","r",stdin);
freopen("evaluare.out","w",stdout);
gets(str);
printf("%d",exp());
return 0;
}