#include <bits/stdc++.h>
using namespace std;
string s, t;
long long cnt, mx, sum;
long long spos, epos, pos = 1, fspos, fepos, ans;
bool check = false;
long long solve(string x) {
  long long num = 1;
  if (x.length() == 1) return x[0] - '0';
  for (long long i = 1; i <= x.length(); i += 2) {
    if (x[i - 1] == 'Y') {
      num *= sum;
    } else
      num *= x[i - 1] - '0';
    if (x[i] == '+') {
      return num + solve(x.substr(i + 1));
    }
  }
  return num;
}
int main(int argc, const char* argv[]) {
  cin >> s;
  vector<long long> t;
  t.push_back(-1);
  for (int i = 0; i < s.length(); i++)
    if (s[i] == '*') t.push_back(i);
  if (t.size() == 1) {
    for (int i = 0; i < s.length(); i += 2) ans += s[i] - '0';
    cout << ans;
    return 0;
  }
  t.push_back(s.length());
  for (long long i = 0; i < t.size() - 1; i++) {
    for (long long j = i + 1; j < t.size(); j++) {
      sum = solve(s.substr(t[i] + 1, t[j] - t[i] - 1));
      if (!(s.substr(0, t[i] + 1) == "" && s.substr(t[j]) == ""))
        ans = max(ans, solve(s.substr(0, t[i] + 1) + 'Y' + s.substr(t[j])));
    }
  }
  cout << ans;
  return 0;
}
