#include <bits/stdc++.h>
using namespace std;
void solve(vector<unsigned long long int> nums, vector<char>& sign, int i,
           unsigned long long int& ans) {
  if (i == 3) {
    ans = min(ans, nums[0]);
    return;
  }
  for (int j = 0; j < nums.size() - 1; j++) {
    for (int k = j + 1; k < nums.size(); k++) {
      unsigned long long int a = nums[j];
      unsigned long long int b = nums[k];
      vector<unsigned long long int> temp = nums;
      temp.erase(temp.begin() + j);
      temp.erase(temp.begin() + k - 1);
      unsigned long long int ne;
      if (sign[i] == '+') {
        ne = (unsigned long long int)(a + b);
      } else
        ne = (unsigned long long int)(a * b);
      temp.push_back(ne);
      solve(temp, sign, i + 1, ans);
    }
  }
}
int main() {
  vector<unsigned long long int> nums(4, 0);
  vector<char> sign(3);
  for (int i = 0; i < 4; i++) cin >> nums[i];
  for (int i = 0; i < 3; i++) cin >> sign[i];
  unsigned long long int ans = ULLONG_MAX;
  solve(nums, sign, 0, ans);
  cout << ans;
}
