#include<iostream>
#include <cstdio>
#include<string>
#include <stack>
using namespace std;
int s = 0, x, y;
stack <int>n;
int main()
{
char ch;
do
{
ch = getchar();//这里无法清除缓存区
//为什么题解还有人用getchar()
//'\n'会再次循环导致报错
if (ch >= '0' && ch <= '9')
s = s * 10 + ch - '0';
else if (ch == '.')
n.push(s), s = 0;
else if (ch != '@')
{
x = n.top();
n.pop();
y = n.top();
n.pop();
switch (ch)
{
case'+':
n.push(x + y); break;
case '-':
n.push(y - x); break;
case '*':
n.push(x * y); break;
case'/':
n.push(y / x); break;
}
}
} while (ch != '@');
cout << n.top();
return 0;
}