#include <bits/stdc++.h>
using namespace std;
long long x, y, k, ans, a[6000];
int i, j, n, m;
int b[6000];
vector<int> f;
string s, t;
pair<long long, long long> solve(int l, int 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.append(s);
  t.append("*1");
  s = t;
  n = s.size();
  m = n >> 1;
  for (i = 0; i < n; i += 2) a[i >> 1] = s[i] - '0';
  for (i = 1; i < n; i += 2)
    if (s[i] == '+')
      b[i >> 1] = 1;
    else {
      b[i >> 1] = 2;
      f.push_back(i >> 1);
    }
  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;
}
