#include <bits/stdc++.h>
using namespace std;
long long eval(vector<long long> a) {
  long long cur = a[0], ans = 0;
  for (int i = 2; i < a.size(); i += 2) {
    if (a[i - 1]) {
      cur *= a[i];
    } else {
      ans += cur;
      cur = a[i];
    }
  }
  ans += cur;
  return ans;
}
long long solve(vector<long long> &a, int x, int y) {
  long long val = eval(vector<long long>(a.begin() + x + 1, a.begin() + y));
  vector<long long> b;
  for (int i = 0; i <= x; ++i) {
    b.push_back(a[i]);
  }
  b.push_back(val);
  for (int i = y; i < a.size(); ++i) {
    b.push_back(a[i]);
  }
  return eval(b);
}
int main() {
  string s;
  cin >> s;
  vector<int> muls;
  muls.push_back(-1);
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == '*') {
      muls.push_back(i);
    }
  }
  muls.push_back(s.size());
  vector<long long> a;
  for (int i = 0; i < s.size(); ++i) {
    if (i % 2) {
      a.push_back(s[i] == '*');
    } else {
      a.push_back(s[i] - '0');
    }
  }
  long long ans = eval(a);
  for (int i = 0; i < muls.size(); ++i) {
    for (int j = i + 1; j < muls.size(); ++j) {
      ans = max(ans, solve(a, muls[i], muls[j]));
    }
  }
  cout << ans;
  return 0;
}
