#include <bits/stdc++.h>
using namespace std;
string buf;
char op[4];
vector<long long> all;
long long mn = 100000000000000;
void go(vector<long long> v) {
  if (v.size() == 1) {
    if (v[0] < mn) mn = v[0];
  }
  int x = 4 - v.size();
  for (int i = 0; i < v.size(); i++) {
    for (int j = i + 1; j < v.size(); j++) {
      vector<long long> tmp;
      for (int k = 0; k < v.size(); k++) {
        if (k != i && k != j) tmp.push_back(v[k]);
      }
      if (op[x] == '+') {
        tmp.push_back(v[i] + v[j]);
      } else {
        tmp.push_back(v[i] * v[j]);
      }
      go(tmp);
    }
  }
}
int main() {
  for (int i = 1; i <= 4; i++) {
    long long a;
    cin >> a;
    all.push_back(a);
  }
  for (int i = 0; i < 3; i++) {
    cin >> buf;
    op[i] = buf[0];
  }
  go(all);
  cout << mn << endl;
  return 0;
}
