#include <bits/stdc++.h>
using namespace std;
long long a[4];
string s;
long long ans = 1e17;
void tryy(vector<long long> left, long long step) {
  if (step == 3) ans = min(ans, left[0]);
  if (s[step] == '+') {
    for (long long i = 0; i < left.size(); ++i) {
      for (long long j = i + 1; j < left.size(); ++j) {
        vector<long long> nt;
        for (long long k = 0; k < left.size(); ++k) {
          if (k != i && k != j) nt.push_back(left[k]);
        }
        nt.push_back(left[i] + left[j]);
        tryy(nt, step + 1);
      }
    }
  } else {
    for (long long i = 0; i < left.size(); ++i) {
      for (long long j = i + 1; j < left.size(); ++j) {
        vector<long long> nt;
        for (long long k = 0; k < left.size(); ++k) {
          if (k != i && k != j) nt.push_back(left[k]);
        }
        nt.push_back(left[i] * left[j]);
        tryy(nt, step + 1);
      }
    }
  }
}
signed main() {
  cin >> a[0] >> a[1] >> a[2] >> a[3];
  sort(a, a + 4);
  s.resize(3);
  cin >> s[0] >> s[1] >> s[2];
  vector<long long> x(a, a + 4);
  tryy(x, 0);
  cout << ans;
  return 0;
}
