#include <bits/stdc++.h>
using namespace std;
int s[5017], n;
int p[20], m;
void segsum(int st, int f, long long int &sum, long long int &cur) {
  for (int k = st; k < f; ++k) {
    if (s[k] == 0) {
      sum += cur;
      cur = 1;
    } else if (s[k] != -1) {
      cur *= s[k];
    }
  }
}
int main() {
  char c;
  s[0] = 1, s[1] = -1, p[0] = 1, m = 1, n = 2;
  while ((c = getchar()) != '\n') {
    if (c == '*') {
      s[n] = -1;
      p[m++] = n;
    } else if (c == '+')
      s[n] = 0;
    else
      s[n] = c - 48;
    ++n;
  }
  s[n] = -1, s[n + 1] = 1, p[m++] = n, n += 2;
  long long int ans = 0;
  for (int i = 0; i < m - 1; ++i)
    for (int j = i + 1; j < m; ++j) {
      long long int ins = 0, sum = 0, cur = 1;
      segsum(p[i] + 1, p[j], sum, cur);
      ins = sum + cur;
      sum = 0, cur = 1;
      segsum(0, p[i], sum, cur);
      cur *= ins;
      segsum(p[j] + 1, n, sum, cur);
      ans = max(ans, cur + sum);
    }
  cout << ans << endl;
  return 0;
}
