#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double pi = acos(-1.0);
const double eps = 1e-9;
long long a[4];
char x[3];
long long r(long long a, long long b, char x) {
  if (x == '+')
    return (a + b);
  else
    return (a * b);
}
long long g(long long a, long long b, long long c, char x, char y) {
  long long ans = inf * 1ll * inf;
  if (x == '+') {
    ans = min(ans, r(a + b, c, y));
    ans = min(ans, r(a + c, b, y));
    ans = min(ans, r(c + b, a, y));
  } else {
    ans = min(ans, r(a * b, c, y));
    ans = min(ans, r(a * c, b, y));
    ans = min(ans, r(c * b, a, y));
  }
  return ans;
}
long long first(long long a, long long b, long long c, long long d, char x,
                char y, char z) {
  long long ans = inf * 1ll * inf;
  if (x == '+') {
    ans = min(ans, g(a + b, c, d, y, z));
    ans = min(ans, g(a + c, b, d, y, z));
    ans = min(ans, g(a + d, c, b, y, z));
    ans = min(ans, g(c + b, a, d, y, z));
    ans = min(ans, g(d + b, a, c, y, z));
    ans = min(ans, g(c + d, a, b, y, z));
  } else {
    ans = min(ans, g(a * b, c, d, y, z));
    ans = min(ans, g(a * c, b, d, y, z));
    ans = min(ans, g(a * d, c, b, y, z));
    ans = min(ans, g(c * b, a, d, y, z));
    ans = min(ans, g(c * d, a, b, y, z));
    ans = min(ans, g(d * b, a, c, y, z));
  }
  return ans;
}
long long ff(long long a, long long b, long long c, long long d, char x, char y,
             char z) {
  long long ans = first(a, b, c, d, x, y, z);
  ans = min(ans, first(a, b, c, d, x, z, y));
  ans = min(ans, first(a, b, c, d, y, z, x));
  ans = min(ans, first(a, b, c, d, y, x, z));
  ans = min(ans, first(a, b, c, d, z, x, y));
  ans = min(ans, first(a, b, c, d, z, y, x));
  return ans;
}
int main() {
  int y;
  for (int i = 0; i < 4; i++) cin >> a[i];
  for (int i = 0; i < 3; i++) cin >> x[i];
  long long ans = first(a[0], a[1], a[2], a[3], x[0], x[1], x[2]);
  cout << ans;
  return 0;
}
