#include <bits/stdc++.h>
using namespace std;
bool visit[4];
long long dfs(vector<long long> &v, vector<char> &chars) {
  long long res = LLONG_MAX;
  if (v.size() == 1) {
    return v.front();
  }
  for (int i = 0; i < v.size() - 1; i++) {
    for (int j = i + 1; j < v.size(); j++) {
      vector<long long> tmp = v;
      tmp.erase(tmp.begin() + i);
      tmp.erase(tmp.begin() + j - 1);
      long long r = 0;
      if (chars.front() == '+') {
        r = v[i] + v[j];
      } else {
        r = v[i] * v[j];
      }
      tmp.push_back(r);
      vector<char> ch = chars;
      ch.erase(ch.begin());
      res = min(res, dfs(tmp, ch));
    }
  }
  return res;
}
int main() {
  vector<long long> v(4);
  vector<char> chars(3);
  for (int i = 0; i < 4; i++) {
    cin >> v[i];
  }
  for (int i = 0; i < 3; i++) {
    cin >> chars[i];
  }
  cout << dfs(v, chars) << endl;
  return 0;
}
