#include using namespace std; main(){ string S; cin >> S; int maxi = 0; for(int i = 0;i < S.length();i++){ int index = 0,val = 0; if(S[0] != '+' && S[0] != '-' && S[S.length()-1] != '+' && S[S.length()-1] != '-'){ for(int j = 0;j < S.length();j++){ if(S[j] == '+' || S[j] == '-'){ val += atoi(S.substr(index,j-index).c_str()); index = j+1; } } val += atoi(S.substr(index,S.length()-index).c_str()); maxi = max(maxi,val); } S = S[S.length()-1] + S; S.erase(S.length()-1); } cout << maxi << endl; }