#include <bits/stdc++.h>
using namespace std;
const int inf = (1 << 28) - 1;
char str[1000005];
stack<int> q, q1;
long long get_stack() {
  long long ans = 1;
  while (!q.empty()) {
    long long tmp = q.top();
    ans *= tmp;
    q.pop();
  }
  return ans;
}
long long get_stack1() {
  long long ans = 1;
  while (!q1.empty()) {
    long long tmp = q1.top();
    ans *= tmp;
    q1.pop();
  }
  return ans;
}
long long cheak(int l, int r, int len) {
  while (!q.empty()) q.pop();
  while (!q1.empty()) q1.pop();
  if (str[l] == '+' || str[l] == '*' || str[r] == '+' || str[r] == '*')
    return 0;
  long long ans = 0;
  for (int i = 0; i < l; ++i)
    if (str[i] >= '0' && str[i] <= '9') {
      long long now = str[i] - '0';
      if (str[i + 1] == '*' && i != len - 1)
        q.push(now);
      else
        ans += now * get_stack();
    }
  long long ans1 = 0;
  for (int i = l; i <= r; ++i)
    if (str[i] >= '0' && str[i] <= '9') {
      long long now = str[i] - '0';
      if (str[i + 1] == '*' && i != r)
        q1.push(now);
      else
        ans1 += now * get_stack1();
    }
  if (str[r + 1] == '*')
    q.push(ans1);
  else
    ans += ans1 * get_stack();
  for (int i = r + 1; i < len; ++i)
    if (str[i] >= '0' && str[i] <= '9') {
      long long now = str[i] - '0';
      if (str[i + 1] == '*' && i != len - 1)
        q.push(now);
      else
        ans += now * get_stack();
    }
  return ans;
}
int main() {
  scanf("%s", str);
  int len = strlen(str);
  long long ans = cheak(0, len - 1, len);
  for (int i = 0; i < len; ++i)
    for (int j = i; j < len; ++j)
      if (str[i - 1] == '*' || str[j + 1] == '*')
        ans = max(ans, cheak(i, j, len));
  printf("%lld\n", ans);
  return 0;
}
