#include <bits/stdc++.h>
using namespace std;
const int maxn = 5000 + 10;
char s[maxn];
int a[40];
int n;
long long calc(int L, int R) {
  long long sum = 0, t = 1, res = 0;
  for (int i = L; i <= R; i++) {
    if (isdigit(s[i])) t *= s[i] - '0';
    if (s[i] == '+') sum += t, t = 1;
  }
  sum += t;
  t = 1;
  for (int i = 1; i <= n; i++) {
    if (i == L)
      t *= sum, i = R;
    else {
      if (isdigit(s[i])) t *= s[i] - '0';
      if (s[i] == '+') res += t, t = 1;
    }
  }
  res += t;
  return res;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  int m = 0;
  a[++m] = 0;
  for (int i = 1; i <= n; i++)
    if (s[i] == '*') a[++m] = i;
  a[++m] = n + 1;
  long long ans = 0;
  for (int i = 1; i < m; i++)
    for (int j = i + 1; j <= m; j++) ans = max(ans, calc(a[i] + 1, a[j] - 1));
  printf("%I64d\n", ans);
  return 0;
}
