import std.array, std.stdio, std.string, std.algorithm, std.conv; void main() { string S = readln.strip; long max = long.min; foreach (i; 0..S.length) { string n = S[i..$] ~ S[0..i]; if (n[0] == '-' || n[0] == '+') continue; if (n[$-1] == '-' || n[$-1] == '+') continue; string[] t; long j = 0; while (j < S.length) { long tmp = j; while(tmp < S.length && '0' <= n[tmp] && n[tmp] <= '9') tmp++; t ~= n[j..tmp]; if (tmp < S.length - 1) t ~= n[tmp..tmp+1]; j = tmp+1; } long acc = t[0].to!long; j = 1; while(j < t.length) { if (t[j] == "+") { acc += t[j+1].to!long; } else if (t[j] == "-") { acc -= t[j+1].to!long; } j += 2; } if (max < acc) max = acc; } writeln(max); }