#include <bits/stdc++.h>
using namespace std;
string s;
long long func(int x, int y) {
  long long ans = 0, curr = s[x] - '0';
  for (int i = x + 1; i <= y; i++) {
    if (s[i] == '+') {
      ans += curr;
      curr = s[i + 1] - '0';
    } else if (s[i] == '*') {
      curr *= s[i + 1] - '0';
    }
  }
  ans += curr;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s1;
  cin >> s1;
  s = "1*" + s1 + "*1";
  int n = s.size();
  long long ans = 0, mx = 0, temp = 0, curr = 1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '+') {
      ans += curr;
      curr = s[i + 1] - '0';
    } else if (s[i] == '*') {
      for (int j = i + 1; j < n; j++) {
        if (s[j] == '*') {
          temp = curr;
          temp *= func(i + 1, j - 1);
          int k = j;
          while (k < n && s[k] == '*') {
            temp *= s[k + 1] - '0';
            k += 2;
          }
          if (k < n) temp += func(k + 1, n - 1);
          mx = max(mx, ans + temp);
        }
      }
      curr *= s[i + 1] - '0';
    }
  }
  cout << mx;
  return 0;
}
