#include <bits/stdc++.h>
using namespace std;
string s[10];
vector<long long> a;
long long rec(int k, vector<long long> x) {
  if (k == 3) return x[0];
  long long ans = 1000 * 1000;
  ans *= 1000 * 1000;
  for (int i = 0; i < x.size(); i++)
    for (int j = i + 1; j < x.size(); j++) {
      vector<long long> b;
      for (int L = 0; L < x.size(); L++) {
        if (L == i || L == j) continue;
        b.push_back(x[L]);
      }
      b.push_back(s[k] == "+" ? x[i] + x[j] : x[i] * x[j]);
      ans = min(ans, rec(k + 1, b));
    }
  return ans;
}
int main() {
  for (int i = 0; i < 4; i++) {
    int x;
    scanf("%d", &x);
    a.push_back(x);
  }
  for (int i = 0; i < 3; i++) cin >> s[i];
  printf("%I64d\n", rec(0, a));
  return 0;
}
