#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-9;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
long long calc(long long a, char op, long long b) {
  if (op == '+')
    return a + b;
  else
    return a * b;
}
long long solve(vector<long long> a, vector<char> op) {
  int n = a.size();
  if (n == 1) return a[0];
  long long ans = 1LL << 60;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < i; j++) {
      long long tmp = calc(a[i], op[0], a[j]);
      vector<long long> nexta(1, tmp);
      for (int k = 0; k < n; k++)
        if (k != i && k != j) nexta.push_back(a[k]);
      vector<char> nextop;
      for (int k = 1; k < op.size(); k++) nextop.push_back(op[k]);
      ans = min(ans, solve(nexta, nextop));
    }
  return ans;
}
int main() {
  vector<long long> a(4);
  for (int i = 0; i < 4; i++) scanf("%I64d ", &a[i]);
  vector<char> op(3);
  for (int i = 0; i < 3; i++) scanf("%c ", &op[i]);
  printf("%I64d\n", solve(a, op));
  return 0;
}
