#include <bits/stdc++.h>
using namespace std;
long long check(int cur_op, vector<char> ops, vector<long long> nums) {
  if (nums.size() == 1) {
    return nums[0];
  }
  long long cur_res = 0, min_res = -1, number;
  vector<long long> new_nums;
  for (int i = 0; i < nums.size(); ++i) {
    for (int j = i + 1; j < nums.size(); ++j) {
      if (ops[cur_op] == '+') {
        number = nums[i] + nums[j];
      } else {
        number = nums[i] * nums[j];
      }
      new_nums.clear();
      new_nums.push_back(number);
      for (int k = 0; k < nums.size(); ++k) {
        if (k != i && k != j) new_nums.push_back(nums[k]);
      }
      cur_res = check(cur_op + 1, ops, new_nums);
      if (min_res == -1 || min_res > cur_res) min_res = cur_res;
    }
  }
  return min_res;
}
int main() {
  vector<long long> nums;
  nums.assign(4, 0);
  vector<char> ops;
  ops.assign(3, ' ');
  cin >> nums[0] >> nums[1] >> nums[2] >> nums[3];
  cin >> ops[0] >> ops[1] >> ops[2];
  cout << check(0, ops, nums);
  return 0;
}
