#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <algorithm>
using std::max;
#include <string>
using std::string;
#include <stack>
using std::stack;

const int pri[13][3] = {{1, 1, 1},{1, 1, 2},{1, 2, 1},{2, 1, 1},{1, 2, 3},{1, 3, 2},{2, 1, 3},{2, 3, 1},{3, 1, 2},{3, 2, 1}, {2, 2, 1}, {2, 1, 2}, {1, 2, 2}};

long long int string_to_lli(string str); 
int check(char c); 
int rep_pri(char c, long long int i); 
long long int inner_calc(long long int first, long long int second, char ope); 
void calc(stack<long long int>& num, stack<char>& ope); 
long long int act(string str, long long int i); 

int main(void) {
    string str;
    cin >> str;

    long long int max_res;
    for (int i = 0; i < 13; i++) {
        long long int ans = act(str, i);
        if (i == 0) {
            max_res = ans; 
        } else {
            max_res = max(max_res, ans);
        }
    }
    cout << max_res << endl;
    return 0;
}

// string??????long long int????????????
long long int string_to_lli(string str) {
    long long int length = str.length();
    long long int number = 0;
    for (long long int i = 0; i < length; i++) {
        number += (long long int)(str[i] - '0');
        number *= 10;
    }
    number /= 10;
    return number;
}

int check(char c) {
    if (c >= '0' && c <= '9') {
        return 0;
    } else if (c == '+' || c == '-' || c == '*') {
        return 1;
    } else {
        return 2;
    }
}

int rep_pri(char c, long long int i) {
    if (c == '+') {
        return pri[i][0];
    } else if (c == '-') {
        return pri[i][1];
    } else if (c == '*') {
        return pri[i][2];
    } else {
        std::cerr << "ERROR_REP_PRI" << endl;
        return -1;
    }
}

long long int inner_calc(long long int first, long long int second, char ope) {
    if (ope == '+') {
        return first + second;
    } else if (ope == '-') {
        return first - second;
    } else if (ope == '*') {
        return first * second;
    } else {
        std::cerr << "ERROR_CALC" << endl;
        return -1;
    }
}

void calc(stack<long long int>& num, stack<char>& ope) {
    long long int second = num.top();
    num.pop();
    long long int first = num.top();
    num.pop();
    num.push(inner_calc(first, second, ope.top()));
    ope.pop();
    return;
}

long long int act(string str, long long int i) {
    long long int ans;
    long long int len = (long long int)str.length();
    stack<long long int> num;
    stack<char> ope;
    for (long long int j = 0; j < len; j++) {
        if (check(str[j]) == 0) {
            int start = j;
            while (check(str[j]) == 0) {
                j++;
            }
            int end = j;
            j--;
            string sub = str.substr(start, end - start);
            num.push(string_to_lli(sub));
            j = end - 1;
            continue;
        } else if (check(str[j]) == 1) {
            if (ope.empty()) {
                ope.push(str[j]);
                continue;
            } else {
                char now = str[j];
                while ((!ope.empty()) && (rep_pri(ope.top(), i) >= rep_pri(now, i))) {
                    calc(num, ope);
                }
                ope.push(now);
                continue;
            }
        } else if (check(str[j]) == 2) {
            int start = j;
            int kakko = 1;
            while (kakko != 0) {
                j++;
                if (str[j] == '(') {
                    kakko++;
                } else if (str[j] == ')') {
                    kakko--;
                }
            }
            int end = j;
            string sub = str.substr(start + 1, end - start - 1);
            num.push(act(sub, i));
        } else {
            std::cerr << "ERROR_ACT" << endl;
        }
    }

    while (!ope.empty()) {
        calc(num, ope);
    }

    return num.top();
}

Measured memory_bytes: 3188