#include <iostream>
#include <vector>
#include <string>
#include <stack>
using namespace std;
int main(){
string str;
cin >> str;
stack<int> stk;
int num = 0;
bool flag = false;
for(char c : str){
if(isdigit(c)){
num = num * 10 + c - '0';
}
else{
if(!stk.empty() && flag == true){
stk.top() *= num;
}
else{
stk.push(num);
}
flag = c == '+' ? false : true;
num = 0;
}
}
stk.top() = flag ? stk.top() * num : stk.top() + num;
int right = 0;
while (!stk.empty())
{
right += stk.top();
stk.pop();
}
cout << right << endl;
return 0;
}