#include <bits/stdc++.h>
using namespace std;
long long int op[3];
long long int ans;
void work(vector<long long int> p, long long int x) {
  if (x == 3) {
    if (ans == -1)
      ans = p[0];
    else if (p[0] < ans)
      ans = p[0];
  } else {
    long long int i, j, k;
    vector<long long int> q;
    for (i = 0; i < p.size(); i++) {
      for (j = i + 1; j < p.size(); j++) {
        q.clear();
        if (op[x] == 0)
          q.push_back(p[i] + p[j]);
        else
          q.push_back(p[i] * p[j]);
        for (k = 0; k < p.size(); k++) {
          if (k == i || k == j) continue;
          q.push_back(p[k]);
        }
        work(q, x + 1);
      }
    }
  }
}
int main() {
  long long int i, j, k;
  string s;
  vector<long long int> a;
  while (cin >> j) {
    a.clear();
    ans = -1;
    a.push_back(j);
    cin >> j;
    a.push_back(j);
    cin >> j;
    a.push_back(j);
    cin >> j;
    a.push_back(j);
    for (i = 0; i < 3; i++) {
      cin >> s;
      if (s == "+") {
        op[i] = 0;
      } else
        op[i] = 1;
    }
    work(a, 0);
    cout << ans << endl;
  }
  return 0;
}
