#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
char a[10000];
long long s[MAXN], len;
int pos[MAXN];
long long solve(int l, int r) {
  long long sum = 0, t1 = 1, t2 = 1, t3 = 1;
  int top = 0;
  if (2 <= l) {
    s[top++] = a[1] - '0';
    for (int i = 2; i <= l - 2; i += 2) {
      if (a[i] == '*')
        s[top - 1] = 1LL * s[top - 1] * (a[i + 1] - '0');
      else if (a[i] == '+')
        s[top++] = (a[i + 1] - '0');
    }
    t1 = s[--top];
    while (top) sum += s[--top];
  }
  s[top++] = a[l + 1] - '0';
  for (int i = l + 2; i <= r - 2; i += 2) {
    if (a[i] == '*')
      s[top - 1] = 1LL * s[top - 1] * (a[i + 1] - '0');
    else if (a[i] == '+')
      s[top++] = (a[i + 1] - '0');
  }
  t2 = 0;
  while (top) t2 += s[--top];
  if (r <= len - 1) {
    s[top++] = a[r + 1] - '0';
    for (int i = r + 2; i <= len - 1; i += 2) {
      if (a[i] == '*')
        s[top - 1] = 1LL * s[top - 1] * (a[i + 1] - '0');
      else if (a[i] == '+')
        s[top++] = (a[i + 1] - '0');
    }
    while (top > 1) sum += s[--top];
    t3 = s[--top];
  }
  sum += 1LL * t1 * t2 * t3;
  return sum;
}
int main() {
  while (scanf("%s", a + 1) != EOF) {
    int cnt = 0;
    pos[++cnt] = 0;
    len = strlen(a + 1);
    for (int i = 1; i <= len; i++)
      if (a[i] == '*') pos[++cnt] = i;
    pos[++cnt] = len + 1;
    long long sum = 0;
    for (int l = 1; l <= cnt; l++)
      for (int r = l + 1; r <= cnt; r++) sum = max(sum, solve(pos[l], pos[r]));
    cout << sum << endl;
  }
  return 0;
}
