#include <bits/stdc++.h>
using namespace std;
long long a[5], ans = 1e18;
char x[4];
void dfs(int k) {
  if (k == 3) {
    ans = min(ans, a[0]);
    return;
  }
  int b[5];
  for (int i = 0; i < 4; i++) b[i] = a[i];
  for (int i = 0; i < 3 - k; i++) {
    if (x[k] == '+')
      a[i] += a[i + 1];
    else
      a[i] *= a[i + 1];
    for (int j = i + 1; j < 4; j++) a[j] = a[j + 1];
    dfs(k + 1);
    for (int i = 0; i < 4; i++) a[i] = b[i];
  }
}
int main() {
  cin >> a[0] >> a[1] >> a[2] >> a[3] >> x[0] >> x[1] >> x[2];
  do dfs(0);
  while (next_permutation(a, a + 4));
  cout << ans;
}
