#include <bits/stdc++.h>
using namespace std;
long long solve(string s) {
  vector<long long> v;
  long long foo = 0;
  v.clear();
  for (long i = 0; i < s.length(); i += 2) {
    long long foo = s[i] - '0';
    while (i != s.length() && s[i + 1] == '*') {
      i += 2;
      foo *= (s[i] - '0');
    }
    v.push_back(foo);
  }
  for (int i = 0; i < v.size(); i++) foo += v[i];
  return foo;
}
int main() {
  long long ans = 0;
  string s;
  cin >> s;
  vector<long long> v;
  vector<int> sign;
  sign.push_back(-1);
  for (long i = 0; i < s.length(); i++)
    if (s[i] == '*') sign.push_back(i);
  sign.push_back(s.length());
  for (int k = 0; k < sign.size() - 1; k++)
    for (int l = k + 1; l < sign.size(); l++) {
      v.clear();
      for (long i = 0; i < s.length(); i += 2) {
        long long foo = s[i] - '0';
        if (i == (sign[k] + 1)) {
          foo = solve(s.substr(i, sign[l] - sign[k] - 1));
          i += sign[l] - sign[k] - 2;
        }
        while (i < s.length() && s[i + 1] == '*') {
          i += 2;
          long long temp = (s[i] - '0');
          if (i == (sign[k] + 1)) {
            temp = solve(s.substr(i, sign[l] - sign[k] - 1));
            i += sign[l] - sign[k] - 2;
          }
          foo *= temp;
        }
        v.push_back(foo);
      }
      long long foo = 0;
      for (int i = 0; i < v.size(); i++) foo += v[i];
      ans = max(foo, ans);
    }
  cout << ans;
}
