#include <bits/stdc++.h>
using namespace std;
int main() {
  long long q, w, w1, e, r, t, c, v, f[5002], f1[5002], ans = 0;
  char a[5002];
  cin >> a;
  q = strlen(a);
  f[q + 1] = 1;
  f1[q + 1] = 0;
  for (w = q - 1; w > 0; w -= 2) {
    f[w] = f[w + 2] * (a[w] - 48);
    f1[w] = f1[w + 2];
    if (a[w - 1] == '+') {
      f1[w] += f[w];
      f[w] = 1;
    }
  }
  c = 1;
  v = 0;
  for (w = 0; w < q; w += 2) {
    e = 1;
    r = 0;
    for (w1 = w; w1 < q; w1 += 2) {
      e *= a[w1] - 48;
      ans = max(ans, v + c * (r + e) * f[w1 + 2] + f1[w1 + 2]);
      if (a[w1 + 1] == '+') {
        r += e;
        e = 1;
      }
    }
    c *= a[w] - 48;
    if (a[w + 1] == '+') {
      v += c;
      c = 1;
    }
  }
  cout << ans;
  return 0;
}
