#include <bits/stdc++.h>
using namespace std;
map<vector<long long>, long long> dp;
char c[5];
long long solve(vector<long long> v) {
  if (v.size() == 1) return v[0];
  if (dp.count(v)) return dp[v];
  long long ans = 1e18;
  int sz = v.size();
  if (sz == 4)
    sz = 1;
  else if (sz == 3)
    sz = 2;
  else if (sz == 2)
    sz = 3;
  for (int i = 0; i < v.size(); i++) {
    for (int j = i + 1; j < v.size(); j++) {
      vector<long long> temp = v;
      long long x = v[i];
      long long y = v[j];
      if (c[sz] == '*') {
        temp.erase(temp.begin() + j);
        temp.erase(temp.begin() + i);
        temp.push_back(x * y);
        ans = min(ans, solve(temp));
      } else {
        temp.erase(temp.begin() + j);
        temp.erase(temp.begin() + i);
        temp.push_back(x + y);
        ans = min(ans, solve(temp));
      }
    }
  }
  return dp[v] = ans;
}
int main() {
  ios::sync_with_stdio(0);
  vector<long long> v;
  long long x;
  for (int i = 0; i < 4; i++) cin >> x, v.push_back(x);
  for (int i = 1; i <= 3; i++) cin >> c[i];
  cout << solve(v);
  return 0;
}
