#include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 32;
long long ans = 1000000000000, v[4], a;
char o[3];
long long solve(int i, int j, char c) {
  long long re;
  if (c == '+')
    re = (v[i] + v[j]);
  else
    re = (v[i] * v[j]);
  return re;
}
long long b[3];
long long solve2(int i, int j) {
  long long re = 0;
  if (o[1] == '+')
    re = b[i] + b[j];
  else
    re = b[i] * b[j];
  int idx = 0;
  for (int n = 0; n < 3; n++)
    if (n != i && n != j) {
      idx = n;
      break;
    }
  if (o[2] == '+')
    re += b[idx];
  else
    re *= b[idx];
  return re;
}
int main() {
  for (int i = 0; i < 4; i++) scanf("%lld", &v[i]);
  for (int i = 0; i < 3; i++) cin >> o[i];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (i == j) continue;
      a = solve(i, j, o[0]);
      b[0] = a;
      int p = 1;
      for (int c = 0; c < 4; c++) {
        if (c != i && c != j) {
          b[p] = v[c];
          p++;
        }
      }
      for (int n = 0; n < 3; n++) {
        for (int m = 0; m < 3; m++) {
          if (n == m) continue;
          ans = min(ans, solve2(n, m));
        }
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
