#include <bits/stdc++.h>
using namespace std;
long long helper(vector<long long> &nums, vector<char> &signs, int idx) {
  if (idx == signs.size()) {
    for (int i = 0; i < nums.size(); i++) {
      if (nums[i] != -1) return nums[i];
    }
    return 1e12;
  }
  long long maxAns = 1e12;
  for (int i = 0; i < nums.size(); i++) {
    for (int j = i + 1; j < nums.size(); j++) {
      if (nums[i] == -1 || nums[j] == -1) continue;
      long long curr = 0;
      long long a = nums[i];
      long long b = nums[j];
      if (signs[idx] == '+') {
        curr = a + b;
      } else {
        curr = a * b;
      }
      nums[i] = -1;
      nums[j] = curr;
      maxAns = min(maxAns, helper(nums, signs, idx + 1));
      nums[i] = a;
      nums[j] = b;
    }
  }
  return maxAns;
}
void solve() {
  int n = 4, m = 3;
  vector<long long> nums(n);
  for (int i = 0; i < n; i++) cin >> nums[i];
  vector<char> signs(m);
  for (int i = 0; i < m; i++) cin >> signs[i];
  long long res = helper(nums, signs, 0);
  cout << res << endl;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
