#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
char a[260];
long long int stack[260];
int main()
{
gets(a);
int i=0;
int top=0;
while(a[i]!='@')
{
if(a[i]=='+')
stack[--top]+=stack[top+1];
else if(a[i]=='-')
stack[--top]-=stack[top+1];
else if(a[i]=='*')
stack[--top]*=stack[top+1];
else if(a[i]=='/')
stack[--top]/=stack[top+1];
else if(a[i]>='0'&&a[i]<='9')
{
int s=0;
while(a[i]!=' ')
s=s*10+a[i++]-'0';
stack[++top]=s;
}
i++;
}
cout<<stack[top];
return 0;
}
洛谷ac,一本通10分。