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

intmax_t apply(intmax_t lhs, char op, intmax_t rhs) {
  switch (op) {
  case '+': return lhs+rhs;
  case '-': return lhs-rhs;
  case '*': return lhs*rhs;
  }
  assert(false);
}

intmax_t parse(
    const std::string &s, size_t &i, const std::vector<std::string> &ops,
    size_t preced=0) {

  if (preced == ops.size()) {
    if (s[i] == '(') {
      intmax_t res=parse(s, ++i, ops, 0);
      assert(s[i] == ')');
      ++i;
      return res;
    }
    if (isdigit(s[i])) {
      intmax_t res=s[i]-'0';
      while (++i < s.length() && isdigit(s[i])) 
        res = res*10+s[i]-'0';
      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;
    intmax_t tmp=parse(s, ++i, ops, preced+1);
    res = apply(res, op, tmp);
  }
  return res;
}

int main() {
  char buf[256];
  scanf("%s", buf);
  std::string s=buf;
  intmax_t res=INTMAX_MIN;
  for (int i=0; i<3; ++i)
    for (int j=0; j<3; ++j)
      for (int k=0; k<3; ++k) {
        std::vector<std::string> tmp(3);
        tmp[i].push_back('+');
        tmp[j].push_back('-');
        tmp[k].push_back('*');
        std::vector<std::string> ops;
        for (const auto &op: tmp)
          if (!op.empty()) ops.emplace_back(op);

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

