#include <bits/stdc++.h>
using namespace std;
long long int x[4], ans = 1000000000000, op, k, s, m;
string a;
int main() {
  scanf("%I64d%I64d%I64d%I64d", &x[0], &x[1], &x[2], &x[3]);
  for (int i = 0; i < 3; i++) cin >> a[i];
  sort(x, x + 4);
  do {
    op = x[0];
    for (int i = 0; i < 3; i++)
      if (a[i] == '+')
        op += x[i + 1];
      else
        op *= x[i + 1];
    ans = min(ans, op);
    if (a[0] == '+')
      s = x[0] + x[1];
    else
      s = x[0] * x[1];
    if (a[1] == '+')
      m = x[2] + x[3];
    else
      m = x[2] * x[3];
    if (a[2] == '+')
      k = s + m;
    else
      k = s * m;
    ans = min(ans, k);
  } while (next_permutation(x, x + 4));
  printf("%I64d", ans);
}
