import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); String s = sc.next(); int length = s.length(); char[] values = (s + s).toCharArray(); long ans = Long.MIN_VALUE; for (int i = 0; i < length; i++) { if (values[i] == '+' || values[i] == '-' || values[i + length - 1] == '+' || values[i + length - 1] == '-') { continue; } long sum = 0; long tmp = 0; boolean isPlus = true; for (int j = 0; j < length; j++) { if (values[i + j] == '+') { if (isPlus) { sum += tmp; } else { sum -= tmp; isPlus = true; } tmp = 0; } else if (values[i + j] == '-') { if (isPlus) { sum += tmp; isPlus = false; } else { sum -= tmp; } tmp = 0; } else { tmp *= 10; tmp += values[i + j] - '0'; } } if (isPlus) { sum += tmp; } else { sum -= tmp; } ans = Math.max(ans, sum); } System.out.println(ans); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }