#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[4];
  char x[3];
  while (scanf("%I64d%I64d%I64d%I64d", &a[0], &a[1], &a[2], &a[3]) == 4) {
    cin >> x[0] >> x[1] >> x[2];
    long long mins = 999999999999999;
    long long b[3], c, tmp;
    for (int i = 0; i < 4; ++i) {
      for (int j = 0; j < 4; ++j) {
        if (i == j) continue;
        if (x[0] == '*')
          b[0] = a[i] * a[j];
        else if (x[0] == '+')
          b[0] = a[i] + a[j];
        int z = 1;
        for (int k = 0; k < 4; k++) {
          if (k == i || k == j) continue;
          b[z] = a[k];
          z++;
        }
        for (int i = 0; i < 3; ++i) {
          for (int j = 0; j < 3; ++j) {
            if (i == j) continue;
            if (x[1] == '*')
              c = b[i] * b[j];
            else if (x[1] == '+')
              c = b[i] + b[j];
            for (int k = 0; k < 3; ++k) {
              if (k == i || k == j) continue;
              if (x[2] == '*')
                tmp = c * b[k];
              else if (x[2] == '+')
                tmp = c + b[k];
              if (tmp < mins) mins = tmp;
            }
          }
        }
      }
    }
    cout << mins << endl;
  }
}
