#include <bits/stdc++.h>
using namespace std;
int a[4], op[3];
long long ans;
long long f(vector<long long> v) {
  if (v.size() == 1) return v[0];
  long long res = (1ll << 62);
  for (int i = 0; i < v.size(); i++) {
    long long vi = v[i];
    v.erase(v.begin() + i);
    for (int j = i; j < v.size(); j++) {
      long long k = v[j], vj = v[j];
      if (op[v.size() - 1])
        k *= vi;
      else
        k += vi;
      v.erase(v.begin() + j);
      v.push_back(k);
      res = min(res, f(v));
      v.pop_back();
      v.insert(v.begin() + j, vj);
    }
    v.insert(v.begin() + i, vi);
  }
  return res;
}
int main() {
  cin >> a[0] >> a[1] >> a[2] >> a[3];
  char c;
  for (int i = 2; i >= 0; i--) {
    cin >> c;
    if (c == '+')
      op[i] = 0;
    else
      op[i] = 1;
  }
  vector<long long> v;
  for (int i = 0; i < 4; i++) v.push_back(a[i]);
  cout << f(v) << endl;
  return 0;
}
