#include <bits/stdc++.h>
using namespace std;
template <class T>
int len(const T &c) {
  return (int)c.size();
}
template <class T>
void cmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
void cmax(T &a, T b) {
  if (b > a) a = b;
}
long long a, b, c, d;
string ch;
long long get(long long aa, long long bb, char cc) {
  if (cc == '+')
    return aa + bb;
  else
    return aa * bb;
}
long long fun(vector<long long> v, string s) {
  vector<long long> v1(len(v) - 1);
  if (len(v) == 1) return v[0];
  string t = s.substr(1);
  sort(v.begin(), v.end());
  long long ret = 99999999999999999LL;
  do {
    v1[0] = get(v[0], v[1], s[0]);
    for (int i(2), _b(len(v)); i < _b; ++i) v1[i - 1] = v[i];
    long long r1 = fun(v1, t);
    cmin(ret, r1);
  } while (next_permutation(v.begin(), v.end()));
  return ret;
}
int main() {
  cin >> a >> b >> c >> d;
  string s;
  vector<long long> v;
  v.push_back(a);
  v.push_back(b);
  v.push_back(c);
  v.push_back(d);
  s = "$";
  cin >> ch;
  s += ch;
  cin >> ch;
  s += ch;
  cin >> ch;
  s += ch;
  s = s.substr(1);
  long long ret = 99999999999999999LL;
  ret = min(ret, fun(v, s));
  cout << ret;
}
