#include <bits/stdc++.h>
using namespace std;
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcount(s);
}
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
string s;
vector<int> vt;
long long cal() {
  long long res = 0, ret = 1, dau = 0;
  for (int i = 0; i < (((int)(s).size())); ++i) {
    if (i & 1) {
      if (s[i] == '+') {
        dau = 0;
        res += ret;
        ret = 1;
      } else {
        dau = 1;
      }
    } else {
      if (dau == 0) {
        ret = s[i] - '0';
      } else {
        ret *= s[i] - '0';
      }
    }
  }
  return res + ret;
}
pair<long long, long long> calcu(int start, int finish) {
  if (finish < start) return make_pair(0, 1);
  long long res = 0, ret = 1, dau = 0;
  for (int i = start; i <= finish; i++) {
    if (i & 1) {
      if (s[i] == '+') {
        dau = 0;
        res += ret;
        ret = 1;
      } else {
        dau = 1;
      }
    } else {
      if (dau == 0) {
        ret = s[i] - '0';
      } else {
        ret *= s[i] - '0';
      }
    }
  }
  return make_pair(res, ret);
}
long long call(int id1, int id2) {
  pair<long long, long long> P1 = calcu(0, vt[id1] - 1);
  pair<long long, long long> P2 = calcu(vt[id1] + 1, vt[id2] - 1);
  int mm = ((int)(s).size());
  for (int i = vt[id2]; i < ((int)(s).size()); i++)
    if (s[i] == '+') {
      mm = i;
      break;
    }
  pair<long long, long long> P3 = calcu(vt[id2] + 1, mm - 1);
  pair<long long, long long> P4 = calcu(mm + 1, ((int)(s).size()) - 1);
  long long res = P1.first +
                  P1.second * (P2.first + P2.second) * (P3.first + P3.second) +
                  (P4.first + P4.second);
  if (mm == ((int)(s).size())) res--;
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s;
  vt.push_back(-1);
  for (int i = 0; i < (((int)(s).size())); ++i) {
    if (s[i] == '*') vt.push_back(i);
  }
  vt.push_back(((int)(s).size()));
  long long res = cal();
  for (int i = 0; i < (((int)(vt).size()) - 1); ++i)
    for (int j = i + 1; j < ((int)(vt).size()); j++) {
      res = max(res, call(i, j));
    }
  cout << res << endl;
  return 0;
}
