#include <bits/stdc++.h>
using namespace std;
using ll = long long;
long double PI = 3.141592653589793238463;
ll u, v, d, t, n, m, x, y, z, q, q3, q2, k, h, sum, cnt,
    mn = 99900000000000, ans, anss, mmxx = -1e13;
ll a[5];
ll aa[5];
ll b[5];
char c[5];
multiset<ll> s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 0; i < 4; i++) {
    cin >> a[i];
  }
  sort(a, a + 4);
  for (int i = 0; i < 3; i++) {
    cin >> c[i];
  }
  do {
    if (c[0] == '*') {
      q = a[0] * a[1];
      aa[0] = q;
      aa[1] = a[2];
      aa[2] = a[3];
      if (c[1] == '*') {
        q2 = aa[0] * aa[1];
        if (c[2] == '*') {
          q3 = q2 * aa[2];
        } else {
          q3 = q2 + aa[2];
        }
        mn = min(mn, q3);
        q2 = aa[0] * aa[2];
        if (c[2] == '*') {
          q3 = q2 * aa[1];
        } else {
          q3 = q2 + aa[1];
        }
        mn = min(mn, q3);
        q2 = aa[2] * aa[1];
        if (c[2] == '*') {
          q3 = q2 * aa[0];
        } else {
          q3 = q2 + aa[0];
        }
        mn = min(mn, q3);
      } else {
        q2 = aa[0] + aa[1];
        if (c[2] == '*') {
          q3 = q2 * aa[2];
        } else {
          q3 = q2 + aa[2];
        }
        mn = min(mn, q3);
        q2 = aa[0] + aa[2];
        if (c[2] == '*') {
          q3 = q2 * aa[1];
        } else {
          q3 = q2 + aa[1];
        }
        mn = min(mn, q3);
        q2 = aa[2] + aa[1];
        if (c[2] == '*') {
          q3 = q2 * aa[0];
        } else {
          q3 = q2 + aa[0];
        }
        mn = min(mn, q3);
      }
    } else {
      q = a[0] + a[1];
      aa[0] = q;
      aa[1] = a[2];
      aa[2] = a[3];
      if (c[1] == '*') {
        q2 = aa[0] * aa[1];
        if (c[2] == '*') {
          q3 = q2 * aa[2];
        } else {
          q3 = q2 + aa[2];
        }
        mn = min(mn, q3);
        q2 = aa[0] * aa[2];
        if (c[2] == '*') {
          q3 = q2 * aa[1];
        } else {
          q3 = q2 + aa[1];
        }
        mn = min(mn, q3);
        q2 = aa[2] * aa[1];
        if (c[2] == '*') {
          q3 = q2 * aa[0];
        } else {
          q3 = q2 + aa[0];
        }
        mn = min(mn, q3);
      } else {
        q2 = aa[0] + aa[1];
        if (c[2] == '*') {
          q3 = q2 * aa[2];
        } else {
          q3 = q2 + aa[2];
        }
        mn = min(mn, q3);
        q2 = aa[0] + aa[2];
        if (c[2] == '*') {
          q3 = q2 * aa[1];
        } else {
          q3 = q2 + aa[1];
        }
        mn = min(mn, q3);
        q2 = aa[2] + aa[1];
        if (c[2] == '*') {
          q3 = q2 * aa[0];
        } else {
          q3 = q2 + aa[0];
        }
        mn = min(mn, q3);
      }
    }
  } while (next_permutation(a, a + 4));
  cout << mn;
  return 0;
}
