#include <cstring>
#include <cstdio>
#include <iostream>
using namespace std;
int a[1001];
int judge(string s){
int tot = 0,i = 0,x;
while(s[i] != '@'){
switch (s[i]){
case '+':
a[--tot] = a[tot] + a[tot+1];
break;
case '-':
a[--tot] = a[tot] - a[tot+1];
break;
case '*':
a[--tot] = a[tot] * a[tot+1];
break;
case '/':
a[--tot] = a[tot] / a[tot+1];
break;
default :
x = 0;
tot++;
while (s[i] != '.'){
x = x*10 + (s[i] - '0');
i++;
}
a[tot] = x;
break;
}
i++;
}
return a[tot];
}
int main (){
string s;
cin >> s;
cout << judge(s);
return 0;
}