#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
using namespace std;

string s;

int calc(){
	if(s[(int)s.size()-1]=='+'||s[(int)s.size()-1]=='-')	return -1*(1<<25);
	if(s[0]=='+'||s[0]=='-')	return -1*(1<<25);
	int ans=0;
	int temp=0;
	string num;
	bool pl=true;
	for(int i=0;i<(int)s.size();i++){
		if(s[i]=='+'){
			if(pl)	ans+=temp;
			else 	ans-=temp;
			pl=true;
			temp=0;
		}
		else if(s[i]=='-'){
			if(pl)	ans+=temp;
			else 	ans-=temp;
			pl=false;
			temp=0;
		}
		else{
			num=s[i];
			temp=temp*10+atoi(num.c_str());
		}
	}
	if(pl)	ans+=temp;
	else 	ans-=temp;
	return ans;
}

int main(){
	cin>>s;
	string temp;
	int ans=calc();
	for(int i=0;i<(int)s.size();i++){
		temp=s[s.size()-1];
		s.erase(s.end()-1);
		s=temp+s;
		ans=max(ans,calc());
	}
	cout<<ans<<endl;
	return 0;
}