#include<bits/stdc++.h>
using namespace std;
stack<int> k;
int main()
{
int s=0,x,y;
char ch;
while(ch!='@'){
ch=getchar();
if(ch>='0'&&ch<='9')
{
s=s*10+ch-'0';
}
else if(ch=='.')
{
k.push(s);
s=0;
}
else if(ch!='@')
{
x=k.top();
k.pop();
y=k.top();
k.pop();
switch(ch)
{
case'+':k.push(x+y); break;
case'-':k.push(x-y); break;
case'*':k.push(x*y); break;
case'/':k.push(x/y); break;
}
}
}
cout<<k.top();
return 0;
}