링크 : https://www.acmicpc.net/problem/1541
/*
문제 : 잃어버린 괄호
링크 : https://www.acmicpc.net/problem/1541
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main(){
string st ;
cin >> st;
int i = 0;
bool flag = false;
string num;
int sum = 0;
for(char ch : st){
if(ch == '+' || ch == '-'){
if(flag){
sum -= stoi(num);
num = "";
}
else{
sum += stoi(num);
num = "";
}
}
else{
num += ch;
}
if(ch == '-'){
flag = true;
}
}
if(flag) sum -= stoi(num);
else sum += stoi(num);
cout << sum;
return 0;
}