#include <bits/stdc++.h>
using namespace std;
int n = 4, a[4];
long long ans = 1e18;
char e[3];
void f(int d, vector<long long> k) {
  if (d == 1) {
    ans = min(ans, k[0]);
    return;
  }
  sort(k.begin(), k.end());
  do {
    vector<long long> i;
    long long x = k[0] + k[1], y = k[0] * k[1];
    if (e[n - d] == '+') {
      i.push_back(x);
    } else {
      i.push_back(y);
    }
    for (int y = 2; y < d; y++) {
      i.push_back(k[y]);
    }
    f(d - 1, i);
  } while (next_permutation(k.begin(), k.end()));
}
void setup();
int main() {
  setup();
  for (int x = 0; x < n; x++) {
    cin >> a[x];
  }
  for (int x = 0; x < n - 1; x++) {
    cin >> e[x];
  }
  sort(a, a + n);
  do {
    vector<long long> q;
    long long x = a[0] + a[1], y = a[0] * a[1];
    if (e[n - 4] == '+') {
      q.push_back(x);
    } else {
      q.push_back(y);
    }
    for (int y = 2; y < n; y++) {
      q.push_back(a[y]);
    }
    f(n - 1, q);
  } while (next_permutation(a, a + n));
  cout << ans;
  return 0;
}
void setup() { ios_base::sync_with_stdio(false); }
