#include <bits/stdc++.h>
using namespace std;
int n, ret = -987654321;
string s;
vector<int> nums;
vector<char> operators;

int oper(char op, int a, int b){
    if(op == '+') return a + b;
    if(op == '-') return a - b;
    if(op == '*') return a * b;
}

void go(int here, int num){
    if(here == nums.size() - 1){
        ret = max(ret, num);
        return;
    }
    
    go(here + 1, oper(operators[here], num, nums[here + 1]));
    
    if(here + 2 < nums.size()){
        int temp = oper(operators[here + 1], nums[here + 1], nums[here + 2]);
        go(here + 2, oper(operators[here], nums[here], temp));
    }
    return;
}

int main(){
    cin >> n >> s;
    for(int i = 0; i < n; i++){
        if(i % 2 == 0) nums.push_back(s[i] - '0');
        else operators.push_back(s[i]);
    }
    
    go(0, nums[0]);
    cout << ret << '\n';
}