#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long inf64 = 0x3f3f3f3f3f3f3f3fLL;
const long double pi = 3.14159265358979;
const long double eps = 1e-7;
int main() {
  long long arr[4];
  for (int i = 0; i < 4; i++) cin >> arr[i];
  char op[3];
  for (int i = 0; i < 3; i++) cin >> op[i];
  set<long long> ans;
  sort(arr, arr + 4);
  do {
    for (int k = 0; k < 2; k++) {
      list<long long> l;
      for (int i = 0; i < 4; i++) l.push_back(arr[i]);
      for (int i = 0; i < 3; i++) {
        long long a = *l.begin();
        l.pop_front();
        long long b = *l.begin();
        l.pop_front();
        long long c;
        if (op[i] == '+')
          c = (a + b);
        else
          c = (a * b);
        if (k)
          l.push_back(c);
        else
          l.push_front(c);
      }
      ans.insert(*l.begin());
    }
  } while (next_permutation(arr, arr + 4));
  cout << *ans.begin() << endl;
  return 0;
}
