#include<bits/stdc++.h>
using namespace std;
int main(){
char ch;
int a;
stack<int> s;
while(cin>>ch&&ch!='@'){
if(ch>='0'&&ch<='9'){
a=a*10+ch-'0';
}
if(ch=='.'){
s.push(a);
a=0;
}
if(ch=='+'||ch=='-'||ch=='*'||ch=='/'){
int x=s.top();
s.pop();
int y=s.top();
s.pop();
if(ch=='+') s.push(x+y);
if(ch=='-') s.push(y-x);
if(ch=='*') s.push(x*y);
if(ch=='/') s.push(y/x);
}
}
cout<<s.top();
}