//KY101 计算表达式
#include <iostream>
#include <algorithm>
#include <cstring>
#include <stack>
#include <queue>
using namespace std;
char op[100005];
int main()
{
while(cin>>op)
{
stack<char>s, s1;
stack<double>p, p1;
int num=0;
for(int i=0;i<strlen(op);i++){
if(op[i]>='0'&&op[i]<='9'){num=num*10+op[i]-'0';}
else{
p.push(num);
num=0;
if(s.empty()) {s.push(op[i]);continue;}
if(s.top()=='/'||s.top()=='*'){
double x1=p.top();
p.pop();
double y1=p.top();
p.pop();
if(s.top()=='/') {p.push(1.0*y1/x1);s.pop();}
else if(s.top()=='*') {p.push(x1*y1);s.pop();}
}
s.push(op[i]);
}
}
if(num!=0){
p.push(num);
num=0;
if(s.empty()) continue;
if(s.top()=='/'||s.top()=='*'){
double x1=p.top();
p.pop();
double y1=p.top();
p.pop();
if(s.top()=='/') {p.push(1.0*y1/x1);s.pop();}
else if(s.top()=='*') {p.push(x1*y1);s.pop();}
}
}
while(s.size()){
s1.push(s.top());
s.pop();
}
while(p.size()){
p1.push(p.top());
p.pop();
}
while(s1.size())
{
char pp=s1.top();
s1.pop();
double y1=p1.top();
p1.pop();
//cout<<y1<<"\n";
double x1=p1.top();
p1.pop();
if(pp=='+') p1.push(x1+y1);
else p1.push(y1-x1);
//cout<<p1.top()<<"--";
}
cout<<int(p1.top())<<"\n";
}
return 0;
}