#include <cstdio>
#include <cstdint>
#include <cctype>
#include <cassert>
#include <vector>
#include <algorithm>
#include <string>
#include <limits>

intmax_t parse_int(std::string const& s, size_t& i) {
  assert(isdigit(s[i]));
  intmax_t res = s[i]-'0';
  while (isdigit(s[++i]))
    res = res*10 + s[i]-'0';
  return res;
}

intmax_t apply(intmax_t lhs, char op, intmax_t rhs) {
  if (op == '+') return lhs + rhs;
  if (op == '-') return lhs - rhs;
  if (op == '*') return lhs * rhs;
  assert(false);
}

intmax_t parse(std::string const& s, size_t& i, std::vector<std::string> const& ops, size_t preced = 0) {
  if (preced == ops.size()) {
    if (isdigit(s[i])) return parse_int(s, i);
    if (s[i] == '(') {
      intmax_t res = parse(s, ++i, ops, 0);
      assert(s[i] == ')');
      ++i;
      return res;
    }
    assert(false);
  }
  intmax_t res = parse(s, i, ops, preced+1);
  while (i < s.length()) {
    char op = s[i];
    if (!std::count(ops[preced].begin(), ops[preced].end(), op)) break;
    res = apply(res, op, parse(s, ++i, ops, preced+1));
  }
  return res;
}

int main() {
  char buf[256];
  scanf("%s", buf);
  std::string s = buf;

  intmax_t res = std::numeric_limits<intmax_t>::min();
  for (size_t i = 0; i < 3; ++i) {
    for (size_t j = 0; j < 3; ++j) {
      for (size_t k = 0; k < 3; ++k) {
        std::vector<std::string> ops(3);
        ops[i].push_back('+');
        ops[j].push_back('-');
        ops[k].push_back('*');
        while (ops.back().empty()) ops.pop_back();
        bool valid = true;
        for (auto const& opsi: ops) {
          if (opsi.empty()) {
            valid = false;
            break;
          }
        }
        if (!valid) continue;

        size_t p = 0;
        res = std::max(res, parse(s, p, ops));
      }
    }
  }
  printf("%jd\n", res);
}

