import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] arr = br.readLine().toCharArray();
        int length = arr.length;
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < length; i++) {
            char[] tmp = new char[length];
            for (int j = 0; j < length; j++) {
                tmp[j] = arr[(i + j) % length];
            }
            if (tmp[0] == '+' || tmp[0] == '-' || tmp[length - 1] == '+' || tmp[length - 1] == '-') {
                continue;
            }
            char op = '+';
            int ans = 0;
            int cur = 0;
            for (int j = 0; j < length; j++) {
                if (tmp[j] == '+' || tmp[j] == '-') {
                    if (op == '+') {
                        ans += cur;
                    } else {
                        ans -= cur;
                    }
                    op = tmp[j];
                    cur = 0;
                } else {
                    cur *= 10;
                    cur += tmp[j] - '0';
                }
            }
            if (op == '+') {
                ans += cur;
            } else {
                ans -= cur;
            }
            max = Math.max(ans, max);
        }
        System.out.println(max);
    }
}