#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5000;
char str[MAXN + 10];
long long sfy[MAXN + 10][MAXN + 10];
int len;
long long ans = 0;
int findl(int in) {
  while (in > 0 && str[in - 1] == '*') in -= 2;
  return in;
}
int findr(int in) {
  while (in < len - 1 && str[in + 1] == '*') in += 2;
  return in;
}
int main(void) {
  scanf("%s", str);
  len = strlen(str);
  for (int i = 0; i < len; i += 2) {
    long long mul = str[i] - '0';
    sfy[i][i] = mul;
    for (int j = i + 1; j < len; j += 2) {
      if (str[j] == '*') {
        sfy[i][j + 1] = sfy[i][j - 1] + mul * (str[j + 1] - '0' - 1);
        mul *= str[j + 1] - '0';
      } else {
        mul = str[j + 1] - '0';
        sfy[i][j + 1] = sfy[i][j - 1] + str[j + 1] - '0';
      }
    }
  }
  for (int i = 0; i < len; i += 2)
    for (int j = i; j < len; j += 2) {
      int l = findl(i), r = findr(j);
      long long p1, p2, p3;
      p2 = sfy[i][j];
      if (l < i) p2 *= sfy[l][i - 2];
      if (r > j) p2 *= sfy[j + 2][r];
      if (l == 0)
        p1 = 0;
      else
        p1 = sfy[0][l - 2];
      if (r == len - 1)
        p3 = 0;
      else
        p3 = sfy[r + 2][len - 1];
      p2 += p1 + p3;
      if (p2 > ans) ans = p2;
    }
  cout << ans << endl;
  return 0;
}
