#include <bits/stdc++.h>
using namespace std;
long long fun(long long a, long long b, char op) {
  return (op == '*') ? a * b : a + b;
}
int main() {
  vector<char> c(3);
  vector<long long> v(4);
  for (int i = 0; i < 4; ++i) cin >> v[i];
  for (int i = 0; i < 3; ++i) cin >> c[i];
  long long mn = numeric_limits<long long>::max();
  sort(v.begin(), v.end());
  do {
    mn = min(mn, fun(fun(v[0], v[1], c[0]), fun(v[2], v[3], c[1]), c[2]));
    mn = min(mn, fun(fun(fun(v[0], v[1], c[0]), v[2], c[1]), v[3], c[2]));
  } while (next_permutation(v.begin(), v.end()));
  cout << mn << endl;
  return 0;
}
