#include <bits/stdc++.h>
using namespace std;
string str;
int n;
long long int eval(int x, int y) {
  int i, j;
  long long int total = 0, k = 0, pr = 1;
  for (i = 0; i < n; i++) {
    if (i == x + 1) {
      long long int l = 1;
      while (i < y) {
        if (str[i] == '+') {
          k += l;
          l = 1;
        } else if (isdigit(str[i])) {
          l *= str[i] - '0';
        }
        i++;
      }
      k += l;
      pr *= k;
    }
    if (str[i] == '+') {
      total += pr;
      pr = 1;
    } else if (isdigit(str[i])) {
      pr *= str[i] - '0';
    }
  }
  total += pr;
  return total;
}
int main(void) {
  cin >> str;
  int i, j;
  long long int max = 0;
  n = str.length();
  vector<int> star;
  i = 0;
  star.push_back(-1);
  for (i = 0; i < n; i++) {
    if (str[i] == '*') star.push_back(i);
  }
  star.push_back(n);
  for (i = 0; i < star.size() - 1; i++) {
    for (j = i + 1; j < star.size(); j++) {
      long long int k = eval(star[i], star[j]);
      if (k > max) max = k;
      ;
    }
  }
  cout << max << endl;
  return 0;
}
