#include <bits/stdc++.h>
using namespace std;
long long x[4], d, best, x1, x2, x3, x4;
char c[3];
int main() {
  scanf("%d%d%d%d", &x[0], &x[1], &x[2], &x[3]);
  cin >> c[0] >> c[1] >> c[2];
  best = 1e13;
  std::sort(x, x + 4);
  do {
    if (c[0] == '*') {
      x1 = x[0] * x[1];
    } else {
      x1 = x[0] + x[1];
    }
    if (c[1] == '*') {
      x2 = x1 * x[2];
    } else {
      x2 = x1 + x[2];
    }
    if (c[2] == '*') {
      x3 = x2 * x[3];
    } else {
      x3 = x2 + x[3];
    }
    best = min(x3, best);
    if (c[0] == '*') {
      x1 = x[0] * x[1];
    } else {
      x1 = x[0] + x[1];
    }
    if (c[1] == '*') {
      x3 = x[2] * x[3];
    } else {
      x3 = x[2] + x[3];
    }
    if (c[2] == '*') {
      x2 = x1 * x3;
    } else {
      x2 = x1 + x3;
    }
    best = min(x2, best);
  } while (std::next_permutation(x, x + 4));
  cout << best << endl;
  return 0;
}
