#include <bits/stdc++.h>
using namespace std;
long long num[3000], numN, mul[20], mulN, sum[3000], sumN;
char oper[3000];
long long calc(long long s, long long t, long long f, long long l) {
  long long sum = num[s], lastll = num[s];
  if (f == s) {
    sum = calc(s, l, -1, -1);
    lastll = sum;
    s = l - 1;
  }
  for (long long i = s + 1; i < t; i++) {
    long long x = num[i];
    if (f == i) x = calc(f, l, -1, -1);
    if (oper[i] == '+') {
      sum += x;
      lastll = x;
    } else {
      sum -= lastll;
      lastll *= x;
      sum += lastll;
    }
    if (f == i) i = l - 1;
  }
  return sum;
}
int main() {
  string s;
  cin >> s;
  long long n = s.size();
  for (long long i = 0; i < n; i++) {
    if (s[i] == '+')
      sum[sumN++] = numN, oper[numN] = '+';
    else if (s[i] == '*')
      mul[mulN++] = numN, oper[numN] = '*';
    else
      num[numN++] = s[i] - '0';
  }
  long long outp = -1;
  mul[mulN++] = 0;
  for (long long f = 0; f < mulN; f++)
    for (long long l = mul[f] + 1; l <= numN; l++)
      outp = max(outp, calc(0, numN, mul[f], l));
  cout << outp << endl;
}
