#include <bits/stdc++.h>
using namespace std;
vector<long long> v[30];
vector<char> vv[6];
long long a[4];
char b[3];
long long sum(long long x, long long y, char ch) {
  if (ch == '+')
    return x + y;
  else
    return x * y;
}
long long cal(int i) {
  long long x, y, z, t, s, u;
  x = sum(sum(sum(v[i][0], v[i][1], b[0]), v[i][2], b[1]), v[i][3], b[2]);
  y = sum(sum(sum(v[i][0], v[i][1], b[0]), v[i][3], b[1]), v[i][2], b[2]);
  z = sum(sum(v[i][0], v[i][1], b[0]), sum(v[i][2], v[i][3], b[1]), b[2]);
  x = min(min(x, y), z);
  return x;
}
int main() {
  long long x = 0;
  for (int i = 0; i < 4; i++) cin >> a[i];
  for (int i = 0; i < 3; i++) cin >> b[i];
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) {
      if (i == j) continue;
      for (int t = 0; t < 4; t++) {
        if (i == t || j == t) continue;
        for (int s = 0; s < 4; s++) {
          if (i == s || j == s || t == s) continue;
          v[x].push_back(a[i]);
          v[x].push_back(a[j]);
          v[x].push_back(a[t]);
          v[x].push_back(a[s]);
          x++;
        }
      }
    }
  long long mini = (long long)1000000000000000000;
  for (int i = 0; i < 24; i++) {
    long long y = cal(i);
    mini = min(mini, y);
  }
  cout << mini << endl;
  return 0;
}
