#include <iostream>
#include <stack>
using namespace std;
stack<long long> number;
int main()
{
long long temp=0;char ch;
bool flag=false;
while( ( ch=getchar() )!='\n')
{
if(flag && ch>='0' && ch<='9' )
{
temp*=10;temp+=ch-'0';continue;
}
if(ch=='.')
{
number.push(temp);flag=false;temp=0;
continue;
}
else if(ch>='0' && ch<='9')
{
temp=ch-'0';flag=true;
continue;
}
else if(ch=='@')
cout<<number.top();
else
{
int A=number.top(); number.pop();
int B=number.top(); number.pop();
switch(ch)
{
case '*':
number.push(A*B);break;
case '/':
number.push(B/A);break;
case '+':
number.push(A+B);break;
case '-':
number.push(B-A);break;
}
}
}
return 0;
}