#include <bits/stdc++.h>
using namespace std;
long long a[4], mins = 1000000000000;
long long c, A, B;
int main() {
  for (int i = 0; i < 4; i++) cin >> a[i];
  char s[3];
  for (int i = 0; i < 3; i++) cin >> s[i];
  sort(a, a + 4);
  do {
    c = a[0];
    for (int i = 0; i < 3; i++) {
      if (s[i] == '+') c += a[i + 1];
      if (s[i] == '*') c *= a[i + 1];
    }
    mins = min(c, mins);
    if (s[0] == '+')
      A = a[0] + a[1];
    else
      A = a[0] * a[1];
    if (s[1] == '+')
      B = a[2] + a[3];
    else
      B = a[2] * a[3];
    long long temp = 0;
    if (s[2] == '*')
      temp = A * B;
    else
      temp = A + B;
    mins = min(mins, temp);
  } while (next_permutation(a, a + 4));
  cout << mins << endl;
  return 0;
}
