#include <bits/stdc++.h>
using namespace std;
const int N = 5500;
char a[N];
int b[N];
char ch[N];
long long dp[N][N];
long long L[N], R[N];
int LL[N], RR[N];
int calc(int st, int en) {
  if (st > en) return 0;
  return dp[st][en];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> a;
  int n = 0;
  for (int i = 0; a[i]; i += 2) {
    char c;
    if (i == 0)
      c = '+';
    else
      c = a[i - 1];
    a[n] = a[i] - '0';
    ch[n++] = c;
  }
  for (int i = 0; i < n; i++) {
    dp[i][i] = a[i];
    long long cur = a[i];
    for (int j = i + 1; j < n; j++) {
      if (ch[j] == '+') {
        dp[i][j] = dp[i][j - 1] + a[j];
        cur = a[j];
      } else {
        dp[i][j] = dp[i][j - 1] - cur + cur * a[j];
        cur *= a[j];
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (ch[i] == '+') {
      LL[i] = i;
      L[i] = 1;
      continue;
    }
    LL[i] = LL[i - 1];
    L[i] = L[i - 1] * a[i - 1];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i == n - 1) {
      R[i] = 1;
      RR[i] = i;
      continue;
    }
    if (ch[i + 1] == '+') {
      R[i] = 1;
      RR[i] = i;
      continue;
    }
    R[i] = R[i + 1] * a[i + 1];
    RR[i] = RR[i + 1];
  }
  long long ans = -1;
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      long long now =
          calc(0, LL[i] - 1) + calc(RR[j] + 1, n - 1) + dp[i][j] * L[i] * R[j];
      ans = max(ans, now);
    }
  }
  cout << ans << endl;
}
