#include <bits/stdc++.h>
using namespace std;
long long ans;
void dfs(vector<long long>& a, vector<int>& b, int t) {
  if ((int)a.size() == 1) {
    ans = min(ans, a[0]);
    return;
  }
  vector<long long> c;
  vector<int> d;
  int i, j, k, l;
  int sz = (int)a.size();
  for (i = 0; i < sz; i++) {
    for (j = i + 1; j < sz; j++) {
      for (k = t; k <= t; k++) {
        long long tmp;
        if (b[k] == 0) {
          tmp = a[i] + a[j];
        } else {
          tmp = a[i] * a[j];
        }
        c.clear();
        d.clear();
        for (l = 0; l < sz; l++) {
          if (l != i && l != j) c.push_back(a[l]);
        }
        c.push_back(tmp);
        dfs(c, b, t + 1);
      }
    }
  }
}
int main() {
  int i, j, k, n;
  char ss[4][10] = {0};
  vector<long long> a;
  vector<int> b;
  for (i = 0; i < 4; i++) {
    scanf("%d", &k);
    a.push_back((long long)k);
  }
  for (i = 0; i < 3; i++) {
    scanf("%s", ss[i]);
    if (ss[i][0] == '+') {
      b.push_back(0);
    } else {
      b.push_back(1);
    }
  }
  ans = 1LL << 62;
  dfs(a, b, 0);
  cout << ans << endl;
  return 0;
}
