#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int min = 9999999999999999;
  char s1, s2, s3;
  long long int a[5], t[5];
  cin >> a[1] >> a[2] >> a[3] >> a[4] >> s1 >> s2 >> s3;
  for (int i = 1; i <= 4; i++) t[i] = a[i];
  for (int i = 1; i <= 4; i++) {
    for (int j = 1; j <= 4; j++) {
      if (i == j) continue;
      for (int ii = 1; ii <= 4; ii++) {
        if (i == ii || j == ii) continue;
        for (int jj = 1; jj <= 4; jj++) {
          if (i == jj || j == jj || ii == jj) continue;
          if (s1 == '+')
            a[j] += a[i];
          else
            a[j] *= a[i];
          if (s2 == '+')
            a[ii] += a[j];
          else
            a[ii] *= a[j];
          if (s3 == '+')
            a[jj] += a[ii];
          else
            a[jj] *= a[ii];
          if (a[jj] < min) min = a[jj];
          for (int k = 1; k <= 4; k++) a[k] = t[k];
          if (s1 == '+')
            a[j] += a[i];
          else
            a[j] *= a[i];
          if (s2 == '+')
            a[jj] += a[ii];
          else
            a[jj] *= a[ii];
          if (s3 == '+')
            a[jj] += a[j];
          else
            a[jj] *= a[j];
          if (a[jj] < min) min = a[jj];
          for (int k = 1; k <= 4; k++) a[k] = t[k];
        }
      }
    }
  }
  cout << min << endl;
  return 0;
}
