#include <bits/stdc++.h>
using namespace std;
long long fun(long long aa, long long bb, char cc) {
  if (cc == '+')
    return aa + bb;
  else
    return aa * bb;
}
int main() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  vector<long long> v(4);
  for (auto &i : v) cin >> i;
  sort(v.begin(), v.end());
  vector<char> s(3);
  for (auto &i : s) cin >> i;
  long long ans = LLONG_MAX;
  sort(v.begin(), v.end());
  do {
    long long aaa = fun(fun(v[0], v[1], s[0]), fun(v[2], v[3], s[1]), s[2]);
    ans = min(ans, aaa);
    aaa = fun(fun(fun(v[0], v[1], s[0]), v[2], s[1]), v[3], s[2]);
    ans = min(ans, aaa);
  } while (next_permutation(v.begin(), v.end()));
  cout << ans;
}
