#include <bits/stdc++.h>
using namespace std;
int main() {
  int p, q, r, s, i, j, m, k = 0;
  long long int x, y, z;
  cin >> p >> q >> r >> s;
  int *b = new int[4];
  b[0] = p;
  b[1] = q;
  b[2] = r;
  b[3] = s;
  sort(b, b + 4);
  char *a = new char[3];
  for (i = 0; i < 3; i++) {
    cin >> a[i];
    if (a[i] == '+') k++;
  }
  if (k == 1) {
    if (a[0] == '+')
      x = (b[2] + b[3]) * b[1] * b[0];
    else if (a[1] == '+') {
      x = (b[0] * b[1] + b[3]) * b[2];
      y = (b[0] * b[1]) * (b[2] + b[3]);
      x = min(x, y);
      z = (b[0] * b[3] + b[2]) * b[1];
      x = min(x, z);
      y = (b[1] * b[2] + b[3]) * b[0];
      x = min(x, y);
      y = (b[0] * b[2] + b[3]) * b[1];
      x = min(x, y);
    } else {
      x = b[0] * b[3] + b[1] * b[2];
      y = b[0] * b[1] + b[2] * b[3];
      x = min(x, y);
    }
  } else if (k == 2) {
    if (b[0] == 0 || b[1] == 0 || b[2] == 0 || b[3] == 0)
      x = 0;
    else if (a[2] == '*') {
      x = (b[3] + b[2] + b[1]) * b[0];
      y = (b[0] + b[1]) * (b[2] + b[3]);
      x = min(x, y);
    } else {
      x = b[0] * b[1] + b[2] + b[3];
    }
  } else if (k == 3) {
    x = b[0] + b[1] + b[2] + b[3];
  } else if (k == 0) {
    x = b[0] * b[1] * b[2];
    x = x * b[3];
  }
  cout << x;
  return 0;
}
