#include<bits/stdc++.h>
using namespace std;
char c;
stack<int>s;
int num,l,r;
int main(){
while (cin>>c){
if (c=='@') break;
if (c>='0' && c<='9') num=num*10+c-'0';
if (c=='.'){
s.push(num);
num=0;
}
else{
l=s.top();
s.pop();
r=s.top();
s.pop();
switch (c){
case '+':s.push(l+r);break;
case '-':s.push(r-l);break;
case '*':s.push(l*r);break;
case '/':s.push(r/l);break;
}
}
}
cout<<s.top();
}