#include <bits/stdc++.h>
using namespace std;
long long int ans, sum, pro;
string s, str;
long long int solve(int st, int end, string z) {
  long long int sum2 = 0, pro2 = 1;
  for (int i = st; i <= end; i++) {
    if (z[i] == '+') {
      sum2 += pro2;
      pro2 = 1;
    } else if (i % 2 == 0)
      pro2 *= s[i] - '0';
  }
  return sum2 + pro2;
}
int main() {
  cin >> s;
  str = "1*";
  str += s;
  str += "*1";
  s = str;
  for (int i = 1; i < s.size(); i += 2) {
    if (s[i] == '+') continue;
    for (int j = i + 2; j < s.size(); j += 2) {
      if (s[j] == '*') {
        sum = 0, pro = 1;
        for (int k = 0; k < s.size(); k++) {
          if (k == i)
            pro *= solve(i + 1, j - 1, s);
          else if (k >= i && k <= j)
            continue;
          else if (s[k] == '+') {
            sum += pro;
            pro = 1;
          } else if (k % 2 == 0)
            pro *= s[k] - '0';
        }
        sum += pro;
        ans = max(ans, sum);
      }
    }
  }
  cout << ans << '\n';
}
