#include <bits/stdc++.h>
using namespace std;
void operate(long long int num[], string &sign, int h, long long int &small) {
  if (h == 3) {
    small = min(small, num[0]);
    return;
  }
  long long int c[5];
  for (int i = 0; i < 4 - h; i++) {
    for (int j = i + 1; j < 4 - h; j++) {
      for (int k = 0; k < 5; k++) c[k] = num[k];
      if (sign[h] == '+')
        c[i] = c[i] + c[j];
      else
        c[i] = c[i] * c[j];
      for (int k = j; k < 4; k++) c[k] = num[k + 1];
      operate(c, sign, h + 1, small);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int num[5];
  for (int i = 0; i < 4; i++) cin >> num[i];
  string signs;
  signs.resize(3);
  for (int i = 0; i < 3; i++) cin >> signs[i];
  long long int small = LLONG_MAX;
  operate(num, signs, 0, small);
  cout << small << endl;
  return 0;
}
