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