#include <bits/stdc++.h>
using namespace std;
int a1[5000];
char s[5010];
int bg, ed, n;
long long f(int a, int b, bool bl) {
  long long r = 0, t;
  if (bl && bg == a)
    t = f(bg, ed, 0), a = ed;
  else
    t = s[a] - 48;
  for (int i = a + 1; i < b; i += 2)
    if (s[i] != '*')
      r += t, t = s[i + 1] - 48;
    else if (bl && i + 1 == bg) {
      t *= f(bg, ed, 0);
      i = ed - 1;
    } else
      t *= s[i + 1] - 48;
  return r + t;
}
int main() {
  int a = 0;
  long long o;
  scanf("%s", s);
  n = strlen(s);
  bg = -1;
  o = f(0, n - 1, 0);
  for (int i = 1; i < n; i += 2)
    if (s[i] == '*') {
      a1[a++] = i;
      bg = i + 1, ed = n - 1;
      o = max(o, f(0, n - 1, 1));
      bg = 0;
      ed = i - 1;
      o = max(o, f(0, n - 1, 1));
    }
  for (int i = 0; i < a; ++i)
    for (int j = i + 1; j < a; ++j) {
      bg = a1[i] + 1;
      ed = a1[j] - 1;
      o = max(o, f(0, n - 1, 1));
    }
  printf("%I64d\n", o);
}
