#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
using namespace std;

typedef long long ll;

string S;
size_t cur=0;
int parse();

int digit(){
    assert(isdigit(S[cur]));
    int n=S[cur]-'0';
    cur++;
    return n;
}

int number(){
    int n=digit();
    while(cur<S.size()&&isdigit(S[cur]))
	n=n*10+digit();
    return n;
}

int expression();
int factor(){
	if(S[cur]!='(')return number();
	cur++;
	int n=expression();
	assert(S[cur]==')');
	cur++;
	return n;
}

int term(){
    int a=factor();
    while(cur<S.size()&&(S[cur]=='*'||S[cur]=='/')){
		char op=S[cur++];
		int b=factor();
		if(op=='*')a*=b; else a/=b;
    }
    return a;
}

int expression(){
    int a=term();
    while(cur<S.size()&&(S[cur]=='+'||S[cur]=='-')){
	char op=S[cur++];
	int b=term();
	if(op=='+')a+=b; else a-=b;
    }
    return a;
}

int main() {
    while(cin>>S){
	cur=0;
	cout<<expression()<<endl;
    }
} 