#include < iostream >
#include < string >
#include < cmath >
using namespace std;
int convert(string s)
{
int x=0, n=s.length();
for(int i=1; i<n; i++)
{
x=x*10;
x=x+s[i]-48;
}
if(s[0]=='+') return x;
if(s[0]=='-') return -x;
}
int node(string s)
{
int x=0, n=s.length();
for(int i=0; i<n; i++)
{
x=x*10;
x=x+s[i]-48;
}
return x;
}
int main()
{
string s; cin >> s;
int result=0, i, j, k=1, temp=1;
int number[100]={0}; int n=s.length();
for(int i=0; i<n; i++)
if(s[i]=='+' || s[i]=='-')
{
number[0]=node(s.substr(0, i)); break; // tính riêng phần tử đầu tiên
}
for(i=0; i<n-1; i++)
for(j=i+1; j<n; j++)
if((s[i]=='+' || s[i]=='-') && (s[j]=='+' || s[j]=='-'))
{
number[k++]=convert(s.substr(i, j-i));
temp++;
i=j;
}
for(int i=n-1; i>=0; i--)
if(s[i]=='+' || s[i]=='-')
{
number[temp+1]=node(s.substr(i+1, n-1-i)); break; // phần tử cuối
}
for(int k=0; k<=temp+1; k++) result+=number[k];
cout << result;
return 0;
}
// Mọi người xem giúp code của em/ mình cần tối ưu chỗ nào