#include <bits/stdc++.h>
using namespace std;
void FastIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
vector<long long int> S;
long long int calc(int start, int end, vector<long long int> second) {
  if (start == end) return second[start];
  long long int ret = 0, pos = start + 1;
  while (pos < end) {
    long long int temp = second[pos - 1];
    while (pos < end && second[pos] == -2) {
      temp *= (second[pos + 1]);
      pos += 2;
    }
    pos += 2;
    ret += temp;
  }
  if (second[end - 1] == -1) ret += second[end];
  return ret;
}
long long int foo(int start, int end) {
  long long int temp = calc(start + 1, end - 1, S);
  vector<long long int> z = S;
  z.erase(z.begin() + start + 1, z.begin() + end);
  z.insert(z.begin() + start + 1, temp);
  return calc(0, z.size() - 1, z);
}
int main() {
  string second;
  cin >> second;
  S.assign(second.length(), 0);
  vector<int> V;
  V.push_back(-1);
  for (int i = 0; i < (int)second.length(); i++) {
    if (i % 2 == 0)
      S[i] = second[i] - '0';
    else if (second[i] == '+')
      S[i] = -1;
    else {
      S[i] = -2;
      V.push_back(i);
    }
  }
  V.push_back(second.length());
  long long int ans = -INT_MAX;
  for (int i = 0; i < (int)V.size(); i++) {
    for (int j = (int)i + 1; j <= (int)V.size() - 1; j++) {
      ans = max(ans, foo(V[i], V[j]));
    }
  }
  cout << ans << '\n';
  return 0;
}
