#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; const double PI = 3.14159265358979323846; const double EPS = 1e-12; typedef pair P; typedef long long ll; typedef unsigned long long ull; const ll INF = 1e11; string s; int n; ll solve(){ ll res = 0, a = 0, r = 1; for(int i = 0; i < n; i++){ char c = s[i]; if(c=='+' || c=='-'){ if(i==0 || i==n-1) return -INF; res += a*r; r = (c=='+'?1:-1); a = 0; } else { a *= 10; a += c-'0'; } } res += a*r; return res; } int main(){ cin>>s; n = s.size(); ll res = -INF; for(int i = 0; i < n; i++){ res = max(res, solve()); s = s.substr(1) + s.substr(0, 1); } cout<