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