#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mod=1e9+7;
const int N=1e5+10;
int priori(char c)
{
if(c=='*'||c=='/')
return 2;
if(c=='+'||c=='-')
return 1;
}
int iswhatandcompute(char c,int n1, int n2)
{
if (c=='*')
return n1*n2;
if(c=='/')
return n2/n1;
if(c=='+')
return n2+n1;
if(c=='-')
return n2-n1;
}
int chartoint(char c)
{
return c-48;
}
int isoperate(char c)
{
if(c=='+'||c=='-'||c=='*'||c=='/')
return 1;
else
return 0;
}
void compute(string s)
{
stack<char> op;
stack<int> num;
int n=0;
int i;
int size_s=s.size();
for(i=0; i<size_s;)
{
if (isoperate(s[i]))
{
num.push(n);
n=0;
if(!op.empty())
{
char temp=op.top();
while(!op.empty()&&priori(op.top())>=priori(s[i]))
{
temp=op.top();
int n1=num.top();
num.pop();
int n2=num.top();
num.pop();
int n3=iswhatandcompute(temp,n1,n2);
num.push(n3);
op.pop();
}
op.push(s[i]);
i++;
}
else
{
op.push(s[i]);
i++;
}
}
else
{
n=n*10+chartoint(s[i]);
i++;
}
}
num.push(n);
while(!op.empty())
{
char t=op.top();
op.pop();
int t1=num.top();
num.pop();
int t2=num.top();
num.pop();
int t3=iswhatandcompute(t,t1,t2);
num.push(t3);
}
int k=num.top();
cout<<k<<endl;
}
int main()
{
string str;
while(cin>>str)
{
compute(str);
}
return 0;
}