#include <fstream>
using namespace std;
ifstream cin("evaluare.in");
ofstream cout("evaluare.out");
char s[100005];
int ind;
int expresie();
int termen();
int factor();
int numar();
int expresie()
{
int x=termen();
while(s[ind]=='+'||s[ind]=='-')
{
if(s[ind]=='+')
{
ind++;
x=x+termen();
}
else if(s[ind]=='-')
{
ind++;
x=x-termen();
}
}
return x;
}
int termen()
{
int y=factor();
while(s[ind]=='*'||s[ind]=='/')
{
if(s[ind]=='*')
{
ind++;
y=y*factor();
}
else if(s[ind]=='/')
{
ind++;
y=y/factor();
}
}
return y;
}
int factor()
{
int nr;
if(s[ind]=='(')
{
ind++;
nr=expresie();
ind++;
}
else nr=numar();
return nr;
}
int numar()
{
int z=0;
while(s[ind]>='0'&&s[ind]<='9')
{
int cif=s[ind]-'0';
z=z*10+cif;
ind++;
}
return z;
}
int main()
{cin.getline(s,100005);
cout<<expresie();
return 0;
}