#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int N = 5e3 + 10;
string s;
int pos[30];
long long solve() {
  int n = s.length(), m = 0;
  long long ans = 0;
  for (auto i = 0; i < n; i++)
    if (s[i] == '*') pos[++m] = i;
  for (auto i = 1; i < m; i++)
    for (auto k = i + 1; k <= m; k++) {
      long long cmul = 0, cans = 0, last = 1;
      for (int j = pos[i] + 1; j < pos[k]; j += 2) {
        if (s[j - 1] == '*')
          last *= s[j] - '0';
        else
          cmul += last, last = s[j] - '0';
      }
      cmul += last;
      last = s[0] - '0';
      for (int j = 2; j < pos[i]; j += 2) {
        if (s[j - 1] == '*')
          last *= s[j] - '0';
        else
          cans += last, last = s[j] - '0';
      }
      last *= cmul;
      for (int j = pos[k] + 1; j < n; j += 2) {
        if (s[j - 1] == '*')
          last *= s[j] - '0';
        else
          cans += last, last = s[j] - '0';
      }
      ans = max(ans, cans + last);
    }
  return ans;
}
int main() {
  cin >> s;
  s = "1*" + s + "*1";
  cout << solve();
}
