#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
char c[5100];
int a[3000], b[3000];
long long int fnd(int q, int w) {
  long long int ans = 0, mn = a[q];
  int i;
  for (i = q; i < w; i++)
    if (b[i] == 1) {
      mn *= a[i + 1];
    } else {
      ans += mn;
      mn = a[i + 1];
    }
  ans += mn;
  return ans;
}
void solve() {
  int i, j, l, k, m, q, w, f;
  long long int ans = 0, z, x = 10;
  k = strlen(c);
  a[0] = 1;
  b[0] = 1;
  for (i = 0, m = 1; i < k - 1; i += 2, m++) {
    a[m] = c[i] - '0';
    if (c[i + 1] == '+')
      b[m] = 2;
    else
      b[m] = 1;
  }
  a[m] = c[k - 1] - '0';
  b[m] = 1;
  a[m + 1] = 1;
  long long int q1, q2, q3, w1, w3;
  for (i = 0; i < m; i++)
    if (b[i] == 1) {
      for (j = i + 1; j <= m; j++)
        if (b[j] == 1) {
          w1 = 0;
          f = i - 1;
          while (f >= 0 && b[f] != 2) f--;
          q1 = fnd(f + 1, i);
          if (f > 0) w1 = fnd(0, f);
          q2 = fnd(i + 1, j);
          w3 = 0;
          f = j + 1;
          while (f <= m + 1 && b[f] != 2) f++;
          q3 = fnd(j + 1, f);
          if (f > 0) w3 = fnd(f + 1, m + 1);
          ans = max(w1 + q1 * q2 * q3 + w3, ans);
        }
    }
  printf("%I64d\n", ans);
}
int main() {
#pragma comment(linker, "/STACK:1073741824")
  int n, m, k, i;
  while (gets(c)) solve();
  return 0;
}
