#include <bits/stdc++.h>
using namespace std;
int ni() {
  int a;
  scanf("%d", &a);
  return a;
}
double nf() {
  double a;
  scanf("%lf", &a);
  return a;
}
char sbuf[100005];
string ns() {
  scanf("%s", sbuf);
  return sbuf;
}
long long nll() {
  long long a;
  scanf("%lld", &a);
  return a;
}
template <class T>
void out(T a, T b) {
  bool first = true;
  for (T i = a; i != b; ++i) {
    if (!first) printf(" ");
    first = false;
    cout << *i;
  }
  printf("\n");
}
template <class T>
void outl(T a, T b) {
  for (T i = a; i != b; ++i) {
    cout << *i << "\n";
  }
}
int n, m;
vector<string> ops;
vector<long long> moo;
long long doIt(vector<long long> moo, int pos) {
  if (moo.size() == 1) return moo[0];
  int i, j, k;
  long long ret = 1000000000000000000LL;
  for (i = (0); i < (((moo.size()))); ++i)
    for (j = (0); j < (((i))); ++j) {
      vector<long long> nw;
      for (k = (0); k < (((moo.size()))); ++k)
        if (i != k && j != k) nw.push_back(moo[k]);
      if (ops[pos][0] == '+')
        nw.push_back(moo[i] + moo[j]);
      else
        nw.push_back(moo[i] * moo[j]);
      ret = min(ret, doIt(nw, pos + 1));
    }
  return ret;
}
int main() {
  int i, j, k;
  for (i = (0); i < (((4))); ++i) moo.push_back(nll());
  for (i = (0); i < (((3))); ++i) ops.push_back(ns());
  printf("%lld\n", doIt(moo, 0));
  return 0;
}
