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