#include<fstream>
#include<cstring>
using namespace std;
ifstream in("evaluare.in");
ofstream out("evaluare.out");
char c[100001],stiva[100001],v[100001];
int n,pri,stiva2[100001],k,s,p,nr;
int priority(char ch) {
if (ch == '*' or ch == '/') return 1;
if (ch == '+' or ch == '-') return 2;
if (ch == '(' or ch == ')') return 3;
return 4;
}
int operatie(int x, int y, char ch) {
if (ch == '+') return x + y;
if (ch == '-') return x - y;
if (ch == '*') return x * y;
if (ch == '/') return x / y;
}
int main (void) {
in >> c+2;
n = strlen(c+2) + 2;
c[1] = '('; c[n] = ')';
for (int i = 1; i <= n; i ++) {
pri = priority(c[i]);
if (c[i] == '(') {
stiva[++s] = c[i];
continue;
}
if (pri== 4){
v[++k] = c[i];
}
else {
while (s > 0 and pri >= priority(stiva[s]) ){
v[++k] = stiva[s];
if (stiva[s] == '(') {
s--;
break;
}
s --;
}
if (c[i] != ')') {
stiva[++s] = c[i];
}
}
}
for (int i = 1; i <= k;) {
if (priority(v[i]) == 4) {
nr = 0;
while (priority(v[i]) == 4 ){
nr = nr *10 + v[i] - '0';
i++;
}
stiva2[++p] = nr;
}
else {
nr = operatie(stiva2[p - 1], stiva2[p], v[i]);
stiva2[--p] = nr;
}
}
out << v + 1;
return 0;
}