#include <bits/stdc++.h>
using namespace std;
char s[5005];
int n, a[105];
long long get(int l, int r) {
  long long ans = 0, tmp = 1;
  for (int i = l; i <= r; i++) {
    if (isdigit(s[i])) {
      tmp *= s[i] - '0';
    }
    if (s[i] == '+') {
      ans += tmp;
      tmp = 1;
    }
  }
  ans += tmp;
  tmp = 1;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    if (i == l) {
      tmp *= ans;
      i = r;
    } else {
      if (isdigit(s[i])) {
        tmp *= s[i] - '0';
      }
      if (s[i] == '+') {
        sum += tmp;
        tmp = 1;
      }
    }
  }
  sum += tmp, tmp = 1;
  return sum;
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  int k = 0;
  a[k++] = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '*') {
      a[k++] = i - 1;
      a[k++] = i + 1;
    }
  }
  if (a[k - 1] != n - 1) a[k++] = n - 1;
  long long maxx = 0;
  for (int i = 0; i < k; i++) {
    for (int j = i; j < k; j++) {
      long long t = get(a[i], a[j]);
      maxx = max(maxx, t);
    }
  }
  printf("%lld\n", maxx);
  return 0;
}
