import java.util.*; public class Exercise111{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); String s = sc.next(); boolean prevIsNum = false; int max = calStr(s); for(int i = 0; i < s.length(); i++){ if(prevIsNum && Character.isDigit(s.charAt(i))){ String f = s.substring(0, i); String l = s.substring(i); String newStr = l + f; int num = calStr(newStr); max = Math.max(max, num); }else{ if(Character.isDigit(s.charAt(i))){ prevIsNum = true; }else{ prevIsNum = false; } } } System.out.println(max); } private static int calStr(String s){ char[] a = s.toCharArray(); int count = 0; for(int i = 0; i < a.length; i++){ if(a[i] == '+' || a[i] == '-'){ count++; } } String[] num = new String[count + 1]; Arrays.fill(num, ""); char[] op = new char[count]; int index = 0; for(int i = 0; i < a.length; i++){ if(Character.isDigit(a[i])){ num[index] += Character.toString(a[i]); }else{ op[index] = a[i]; index++; } } int sum = Integer.parseInt(num[0]); for(int i = 1; i < num.length; i++){ if(op[i - 1] == '+'){ sum += Integer.parseInt(num[i]); }else{ sum -= Integer.parseInt(num[i]); } } return sum; } }