#include <bits/stdc++.h>
using namespace std;
long long arr[4];
long long ans = 0;
char o[4];
int Permutation[4];
int main() {
  for (int i = 0; i < 4; ++i) {
    Permutation[i] = i;
  }
  cin >> arr[0] >> arr[1] >> arr[2] >> arr[3];
  cin >> o[1] >> o[2] >> o[3];
  long long ans = 1e12 + 1;
  do {
    long long ans1 = arr[Permutation[0]];
    for (int i = 1; i < 4; ++i) {
      if (o[i] == '*') {
        ans1 *= arr[Permutation[i]];
      } else {
        ans1 += arr[Permutation[i]];
      }
    }
    long long ans2 = arr[Permutation[0]];
    if (o[1] == '*') {
      ans2 *= arr[Permutation[1]];
    } else {
      ans2 += arr[Permutation[1]];
    }
    long long rs;
    if (o[2] == '*') {
      rs = arr[Permutation[2]] * arr[Permutation[3]];
    } else {
      rs = arr[Permutation[2]] + arr[Permutation[3]];
    }
    if (o[3] == '*') {
      ans2 *= rs;
    } else {
      ans2 += rs;
    }
    ans1 = min(ans1, ans2);
    ans = min(ans, ans1);
  } while (next_permutation(Permutation, Permutation + 4));
  cout << ans << endl;
  return 0;
}
