#include <bits/stdc++.h>
using namespace std;
long long n;
string str;
long long calc(long long L, long long R) {
  vector<long long> v;
  v.push_back(str[L] - '0');
  for (long long j = L + 2; j <= R; j += 2) {
    if (str[j - 1] == '+')
      v.push_back(str[j] - '0');
    else
      v.back() *= (str[j] - '0');
  }
  long long ret = 0;
  for (long long j = 0; j < v.size(); j++) ret += v[j];
  return ret;
}
long long TRY(long long open, long long close) {
  vector<long long> v;
  long long V;
  for (long long j = 1; j <= n; j += 2) {
    if (j == open)
      V = calc(open, close);
    else
      V = str[j] - '0';
    if (str[j - 1] == '+')
      v.push_back(V);
    else {
      if (v.empty())
        v.push_back(V);
      else
        v.back() *= V;
    }
    if (j == open) j = close;
  }
  long long ret = 0;
  for (long long j = 0; j < v.size(); j++) ret += v[j];
  return ret;
}
vector<long long> open, close;
int main() {
  cin >> str;
  str = "#" + str;
  n = str.size() - 1;
  for (long long j = 1; j <= n; j++) {
    if (str[j] == '*') {
      open.push_back(j + 1);
      close.push_back(j - 1);
    }
  }
  open.push_back(1);
  close.push_back(n);
  long long ans = 0;
  for (long long j = 0; j < open.size(); j++)
    for (long long i = 0; i < close.size(); i++)
      if (open[j] <= close[i]) ans = max(ans, TRY(open[j], close[i]));
  ans = max(ans, calc(1, n));
  cout << ans << endl;
}
