#include <bits/stdc++.h>
using namespace std;
long long res = (1LL << 60LL);
string second[4];
void rec(int x, vector<long long> v) {
  if (v.size() == 1) res = min(res, v[0]);
  for (int i = 0; i < v.size() - 1; i++)
    for (int j = i + 1; j < v.size(); j++) {
      vector<long long> tmp;
      tmp = v;
      if (second[x] == "*")
        tmp[i] *= tmp[j];
      else
        tmp[i] += tmp[j];
      tmp.erase(tmp.begin() + j);
      rec(x + 1, tmp);
    }
}
int main() {
  vector<long long> v;
  long long a[5];
  v.resize(4);
  for (int i = 0; i < 4; i++) cin >> a[i], v[i] = a[i];
  for (int i = 0; i < 3; i++) cin >> second[i];
  rec(0, v);
  cout << res;
  return 0;
}
