#include using ll = long long; using namespace std; string str; int i=0; int func(); int calc(){ int num = func(); while(1){ if(str[i]=='+'){ i++; num+=func(); } else if(str[i]=='-'){ i++; num-=func(); } else return num; } } int func(){ if('0'<=str[i]&&str[i]<='9'){ int res=str[i]-'0'; i++; return res; } if(str[i]=='('){ i++; int res=calc(); i++; return res; } } int main(){ cin >> str; cout << calc() << endl; return 0; }