#include <bits/stdc++.h>
using namespace std;
long long n, i, j = 0, k, l, T, c = 0, t = 0;
long long a[10010], d[10010], e[10010];
string s;
int main() {
  getline(cin, s);
  a[0] = s[0] - 48;
  d[0] = a[0];
  e[0] = 0;
  for (i = 1; i < s.length() - 1; i += 2) {
    if (s[i] == '*') {
      a[i + 1] = a[i - 1] - d[i - 1] + d[i - 1] * (s[i + 1] - 48);
      d[i + 1] = d[i - 1] * (s[i + 1] - 48);
      e[i + 1] = i + 1;
      for (k = j; k < i; k += 2) {
        e[k] = i + 1;
        d[k] = d[i + 1];
      }
    } else if (s[i] == '+') {
      a[i + 1] = a[i - 1] + s[i + 1] - 48;
      d[i + 1] = s[i + 1] - 48;
      e[i + 1] = i + 1;
      j = i + 1;
    }
  }
  for (i = 1; i < s.length() - 1; i += 2) {
    if (s[i] == '*') {
      t = 1;
      c = max(c, a[i - 1] * (d[i + 1] / (s[i - 1] - 48)) + a[s.length() - 1] -
                     a[e[i + 1]]);
      if (i > 1) {
        if (s[i - 2] == '+') {
          c = max(c, a[i - 3] + (d[e[i + 1]] / (s[e[i + 1]] - 48)) *
                                    (a[s.length() - 1] - a[e[i + 1]] +
                                     (s[e[i + 1]] - 48)));
        }
      } else {
        c = max(c, (d[e[i + 1]] / (s[e[i + 1]] - 48)) *
                       (a[s.length() - 1] - a[e[i + 1]] + (s[e[i + 1]] - 48)));
      }
      for (j = e[i + 1] + 1; j < s.length() - 1; j += 2) {
        if (s[j] == '*' and s[j - 2] == '+') {
          c = max(c, a[i - 3] +
                         (d[i + 1] / (s[e[i + 1]] - 48)) *
                             (d[j + 1] / (s[j - 1] - 48)) *
                             (a[j - 1] - a[e[i + 1]] + s[e[i + 1]] - 48) +
                         a[s.length() - 1] - a[e[j + 1]]);
        }
      }
      i = e[i + 1] - 1;
    }
  }
  if (t == 0) {
    c = a[s.length() - 1];
  }
  cout << c;
}
