#include<iostream>
#include<stack>
using namespace std;
stack<int>s;
int x,y,z;
int num=0;
int k=0;
int main(){
char ip;
while(ip!='@'){
ip=getchar();
if(ip>='0'&&ip<='9')
{
k=k*10+ip-'0';
}
else if(ip=='.'){
s.push(k);
k=0;
continue;
}
else if(ip=='+'){
x=s.top();
s.pop();
y=s.top();
s.pop();
z=x+y;
s.push(z);
}
else if(ip=='-'){
x=s.top();
s.pop();
y=s.top();
s.pop();
z=y-x;
s.push(z);
}
else if(ip=='*'){
x=s.top();
s.pop();
y=s.top();
s.pop();
z=x*y;
s.push(z);
}
else if(ip=='/'){
x=s.top();
s.pop();
y=s.top();
s.pop();
z=y/z;
s.push(z);
}
}
cout<<s.top()<<endl;
return 0;
}