#include <bits/stdc++.h>
using namespace std;
long long i, j, n, x, y, m, k, ans, a[6000], b[6000];
vector<long long> f;
string s, t;
pair<long long, long long> solve(long long l, long long r) {
  long long x = 0, y = a[l];
  for (int i = l; i < r; i++)
    if (b[i] == 1)
      x += y, y = a[i + 1];
    else
      y *= a[i + 1];
  return make_pair(x, y);
}
int main() {
  cin >> s;
  t = "1*";
  t += s;
  t += "*1";
  s = t;
  n = s.size();
  m = n / 2;
  for (i = 0; i < n; i += 2) a[i / 2] = s[i] - '0';
  for (i = 1; i < n; i += 2)
    if (s[i] == '+')
      b[i / 2] = 1;
    else {
      b[i / 2] = 2;
      f.push_back(i / 2);
    }
  long long max1 = 0;
  for (i = 0; i < f.size(); i++)
    for (j = i + 1; j < f.size(); j++) {
      pair<long long, long long> tmp = solve(0, f[i]);
      x = tmp.first, y = tmp.second;
      tmp = solve(f[i] + 1, f[j]);
      y *= tmp.first + tmp.second;
      long long xx = a[f[j]];
      a[f[j]] = y;
      tmp = solve(f[j], m);
      max1 = max(max1, x + tmp.first + tmp.second);
      a[f[j]] = xx;
    }
  cout << max1 << endl;
  return 0;
}
