#include <bits/stdc++.h>
using namespace std;
string s;
int n;
long long d[3000][3000];
long long ccc[30];
int main() {
  cin >> s;
  n = s.size() / 2 + 1;
  for (int i = 0; i < n; i++) {
    d[i][i] = s[2 * i] - '0';
    for (int j = i + 1; j < n; j++) {
      d[i][j] = s[2 * j] - '0';
      int k = j - 1;
      while (k >= i && s[2 * k + 1] == '*') {
        d[i][j] *= s[2 * k] - '0';
        k--;
      }
      if (k >= i) d[i][j] += d[i][k];
    }
  }
  long long maxi = d[0][n - 1];
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      long long res = d[i][j - 1];
      int k = i - 1;
      while (k >= 0 && s[2 * k + 1] == '*') {
        res *= s[2 * k] - '0';
        k--;
      }
      int l = j;
      while (l < n && s[2 * l - 1] == '*') {
        res *= s[2 * l] - '0';
        l++;
      }
      if (k >= 0) res += d[0][k];
      if (l <= n - 1) res += d[l][n - 1];
      maxi = max(maxi, res);
    }
  }
  cout << maxi << endl;
  return 0;
}
