#include <bits/stdc++.h>
int main(void) {
  std::string s;
  std::cin >> s;
  int n = s.size();
  std::vector<std::pair<long long unsigned, long long unsigned>> left;
  left.push_back(std::make_pair(0, 1));
  for (long long unsigned i = 0, a = 0, b = 1; i < n; i += 2) {
    if (i == 0 || s[i - 1] == '*') {
      b *= s[i] - '0';
    } else {
      a += b;
      b = s[i] - '0';
    }
    if (i + 1 == n || s[i + 1] == '+') {
      left.push_back(std::make_pair(a + b, 1));
    } else {
      left.push_back(std::make_pair(a, b));
    }
  }
  std::vector<std::pair<long long unsigned, long long unsigned>> right;
  right.push_back(std::make_pair(0, 1));
  for (long long i = n - 1, a = 0, b = 1; i >= 0; i -= 2) {
    if (i == n - 1 || s[i + 1] == '*') {
      b *= s[i] - '0';
    } else {
      a += b;
      b = s[i] - '0';
    }
    if (i == 0 || s[i - 1] == '+') {
      right.push_back(std::make_pair(a + b, 1));
    } else {
      right.push_back(std::make_pair(a, b));
    }
  }
  std::reverse(right.begin(), right.end());
  long long unsigned best_value = 0;
  for (int i = 0, ik = 0; i < n; i += 2, ++ik) {
    for (long long unsigned j = i, jk = ik, a = 0, b = 1; j < n; j += 2, ++jk) {
      if (j == i || s[j - 1] == '*') {
        b *= s[j] - '0';
      } else {
        a += b;
        b = s[j] - '0';
      }
      long long unsigned value =
          (left[ik].first + right[jk + 1].first) +
          (a + b) * (left[ik].second * right[jk + 1].second);
      best_value = std::max(value, best_value);
    }
  }
  std::cout << best_value << std::endl;
  return 0;
}
