#include <bits/stdc++.h>
using namespace std;
char S[5003];
int n, a, A[20], top, cnt, Now[5003];
long long ans, Sk[5003];
int Check(int s, int e, int now) {
  int fo = 0;
  for (; now <= n; ++now) {
    if (S[now] == '+')
      ++fo;
    else if (S[now] == '*')
      ;
    else if (now == s) {
      Now[++cnt] = S[now] - '0';
      now = Check(s, e, now + 1);
      if (S[s - 1] == '*') Now[++cnt] = -1;
    } else {
      Now[++cnt] = S[now] - '0';
      if (S[now - 1] == '*' && now != s) Now[++cnt] = -1;
      if (now == e) {
        while (fo) Now[++cnt] = 0, --fo;
        return now;
      }
    }
  }
  while (fo) Now[++cnt] = 0, --fo;
  return now;
}
void DO() {
  top = 0;
  for (int i = 1; i <= cnt; ++i) {
    if (Now[i] <= 0) {
      if (Now[i])
        Sk[top - 1] *= Sk[top];
      else
        Sk[top - 1] += Sk[top];
      --top;
    } else
      Sk[++top] = Now[i];
  }
  ans = max(ans, Sk[top]);
}
int main() {
  scanf("%s", S + 1);
  n = strlen(S + 1);
  for (int i = 1; i <= n; ++i)
    if (S[i] == '*') A[++a] = i;
  for (int i = 1; i <= a; ++i) {
    for (int j = 1; j < A[i]; j += 2) cnt = 0, Check(j, A[i] - 1, 1), DO();
    for (int j = A[i] + 1; j < n; j += 2) cnt = 0, Check(A[i] + 1, j, 1), DO();
  }
  cnt = 0, Check(1, 1, 1), DO();
  printf("%lld\n", ans);
  return 0;
}
