#include <bits/stdc++.h>
using namespace std;
void problem_solver() {
  vector<long long> arr(4);
  for (long long i = 0; i < 4; i++) cin >> arr[i];
  vector<char> operand(3);
  for (long long i = 0; i < 3; i++) cin >> operand[i];
  long long ans = LLONG_MAX;
  for (long long i = 0; i < 3; i++) {
    for (long long j = i + 1; j < 4; j++) {
      vector<long long> res;
      long long val;
      if (operand[0] == '+') {
        val = arr[i] + arr[j];
      } else {
        val = arr[i] * arr[j];
      }
      for (long long k = 0; k < 4; k++) {
        if (k == i || k == j) continue;
        res.push_back(arr[k]);
      }
      res.push_back(val);
      void(0);
      ;
      for (long long k = 0; k < 2; k++) {
        for (long long l = k + 1; l < 3; l++) {
          long long cur;
          if (operand[1] == '+') {
            cur = res[k] + res[l];
          } else {
            cur = res[k] * res[l];
          }
          for (long long m = 0; m < 3; m++) {
            if (m != k && m != l) {
              if (operand[2] == '+') {
                cur = cur + res[m];
              } else {
                cur = cur * res[m];
              }
              ans = min(ans, cur);
            }
          }
        }
      }
    }
  }
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long t = 1;
  while (t--) {
    problem_solver();
    cout << '\n';
  }
}
