#include <bits/stdc++.h>
using namespace std;
long long fr(vector<long long>&, vector<char>&);
long long gres;
int main(int argc, char** argv) {
  ifstream from;
  const long long amin = 0, amax = 1000, na = 4;
  long long n, m, res, rt, i, j, k, ax, x;
  char ch;
  if (0) from.open("test.txt");
  vector<long long> v(na);
  vector<char> vc(na - 1);
  for (i = 0; i < na; i++) cin >> v[i];
  for (i = na - 2; i >= 0; i--) cin >> vc[i];
  res = v.back();
  for (i = na - 2; i >= 0; i--) {
    ch = vc[i];
    if (ch == '+')
      res += v[i];
    else if (ch == '*')
      res *= v[i];
  }
  gres = res;
  rt = fr(v, vc);
  res = gres;
  cout << res << endl;
  return 0;
}
long long fr(vector<long long>& v, vector<char>& vc) {
  long long n, m, res, rt, i, j, k, ax, x, y, z, na;
  char ch;
  na = v.size();
  if (na == 2) {
    x = v.front();
    y = v.back();
    ch = vc.back();
    if (ch == '+')
      rt = x + y;
    else if (ch == '*')
      rt = x * y;
    gres = (rt < gres) ? rt : gres;
  } else if (na > 2) {
    for (i = 0; i < na - 1; i++) {
      x = v[i];
      for (j = i + 1; j < na; j++) {
        y = v[j];
        v[j] = v.back();
        v.pop_back();
        ch = vc.back();
        vc.pop_back();
        if (ch == '+')
          z = x + y;
        else if (ch == '*')
          z = x * y;
        v[i] = z;
        rt = fr(v, vc);
        vc.push_back(ch);
        v.push_back(v[j]);
        v[i] = x;
        v[j] = y;
      }
    }
  }
  return 0;
}
