#include using namespace std; int evaluate( const string &s ){ if( not ( '0' <= s[ 0 ] and s[ 0 ] <= '9' ) ) return -0x3f3f3f3f; if( not ( '0' <= s.back() and s.back() <= '9' ) ) return -0x3f3f3f3f; vector< int > val; vector< char > op; for( int i = 0; i < s.size(); ++i ){ if( not ( '0' <= s[ i ] and s[ i ] <= '9' ) ) op.emplace_back( s[ i ] ); else{ int v = 0; for( int j = i; j < s.size(); ++j ){ if( not ( '0' <= s[ j ] and s[ j ] <= '9' ) ){ i = j - 1; break; } v = v * 10 + s[ j ] - '0'; } val.emplace_back( v ); } } int res = val[ 0 ]; for( int i = 1; i < val.size(); ++i ) res += ( op[ i - 1 ] == '+' ? 1 : -1 ) * val[ i ]; return res; } signed main(){ string S; cin >> S; S = S + S; int ans = -0x3f3f3f3f; for( int i = 0; i < S.size() / 2; ++i ) ans = max( ans, evaluate( S.substr( i, S.size() / 2 ) ) ); cout << ans << endl; return 0; }