#include <bits/stdc++.h>
using namespace std;
const int N = 10010;
char s[N];
int len;
long long calc(int l, int r) {
  long long val = 0;
  long long tmp = (long long)(s[l] - '0');
  for (int i = l + 1; i < r; i += 2) {
    if (s[i] == '*')
      tmp *= (long long)(s[i + 1] - '0');
    else {
      val += tmp;
      tmp = (long long)(s[i + 1] - '0');
    }
  }
  val += tmp;
  long long res = 0;
  tmp = (long long)(s[0] - '0');
  if (l == 0) tmp = val;
  for (int i = (l == 0 ? r : 1); i < len; i += 2) {
    if (i + 1 == l) {
      tmp *= val;
      i = r - 2;
      continue;
    }
    if (s[i] == '*')
      tmp *= (long long)(s[i + 1] - '0');
    else {
      res += tmp;
      tmp = (long long)(s[i + 1] - '0');
    }
  }
  res += tmp;
  return res;
}
int main() {
  scanf("%s", s);
  len = strlen(s);
  vector<int> e;
  e.push_back(-1);
  for (int i = 0; i < len; i++)
    if (s[i] == '*') e.push_back(i);
  e.push_back(len);
  long long ans = 0;
  for (int i = 0; i < e.size(); i++)
    for (int j = i + 1; j < e.size(); j++) ans = max(ans, calc(e[i] + 1, e[j]));
  printf("%lld\n", ans);
}
