#include <bits/stdc++.h>
using namespace std;
long long a[5], b[4], ans = 0x7f7f7f7f7f7f7f7f;
void dfs(int x) {
  if (x == 1) {
    if (a[1] < ans) ans = a[1];
    return;
  }
  long long p = 4 - x + 1;
  for (int i = 1; i <= 4; i++)
    for (int j = i + 1; j <= 4; j++) {
      if (a[i] == -1 || a[j] == -1) continue;
      long long tmp1 = a[i], tmp2 = a[j];
      if (b[p] == 1) {
        a[i] = a[i] + a[j], a[j] = -1;
        dfs(x - 1);
      } else if (b[p] == 2) {
        a[i] = a[i] * a[j], a[j] = -1;
        dfs(x - 1);
      }
      a[i] = tmp1, a[j] = tmp2;
    }
  return;
}
int main() {
  char tmp;
  scanf("%lld%lld%lld%lld", &a[1], &a[2], &a[3], &a[4]);
  for (int i = 1; i <= 3; i++) {
    scanf("%c%c", &tmp, &tmp);
    if (tmp == '+')
      b[i] = 1;
    else
      b[i] = 2;
  }
  dfs(4);
  printf("%lld\n", ans);
  return 0;
}
