#include <bits/stdc++.h>
using namespace std;
ifstream fin("evaluare.in");
ofstream fout("evaluare.out");
const int pd=1000000001, inm=1000000002, mi=1e9+3, divi=1e9+4;
char s[100005];
int st[100005], top;
int main()
{
fin>>s;
int nr=0;
for(int i=0; s[i]!='\0'; i++)
{
char c=s[i];
if(c=='(')
st[++top]=pd;
else if(c=='-')
st[++top]=mi;
else if(c=='*')
st[++top]=inm;
else if(c=='/')
st[++top]=divi;
else if(c>='0' && c<='9')
{
nr=0;
while(s[i]>='0' && s[i]<='9')
{
nr=nr*10+(s[i]-'0');
i++;
}
i--;
if(top==0 || st[top]==pd || st[top]<=1e9)
st[++top]=nr;
else
{
if(st[top]==mi)
st[top]=-nr;
else if(st[top]==inm || st[top]==divi)
{
int op=st[top--];
if(op==inm)
st[top]=st[top]*nr;
else st[top]=st[top]/nr;
}
}
}
else if(c==')')
{
nr=0;
while(st[top]!=pd)
nr+=st[top--];
top--;
if(top==0 || st[top]==pd || st[top]<=1e9)
st[++top]=nr;
else
{
if(st[top]==mi)
st[top]=-nr;
else if(st[top]==inm || st[top]==divi)
{
int op=st[top--];
if(op==inm)
st[top]=st[top]*nr;
else st[top]=st[top]/nr;
}
}
}
}
int r=0;
while(top>0)
r+=st[top--];
fout<<r;
return 0;
}