#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long a[4], ans = (long long)1e18;
char op[3];
void dfs(long long num, vector<long long> v) {
  if (num == 3) {
    ans = min(ans, v[0]);
    return;
  }
  for (int i = 0; i < v.size(); i++)
    for (int j = i + 1; j < v.size(); j++) {
      vector<long long> tmp;
      for (int k = 0; k < v.size(); k++) tmp.push_back(v[k]);
      if (op[num] == '*') {
        tmp.push_back(tmp[i] * tmp[j]);
        tmp.erase(tmp.begin() + i);
        tmp.erase(tmp.begin() + j - 1);
        dfs(num + 1, tmp);
      } else {
        tmp.push_back(tmp[i] + tmp[j]);
        tmp.erase(tmp.begin() + i);
        tmp.erase(tmp.begin() + j - 1);
        dfs(num + 1, tmp);
      }
    }
}
int main() {
  cin >> a[0] >> a[1] >> a[2] >> a[3];
  long long c = 0, j = 0;
  for (int i = 0; i < 3; i++) {
    cin >> op[i];
    if (op[i] == '*')
      c++;
    else
      j++;
  }
  if (c == 3) {
    cout << a[0] * a[1] * a[2] * a[3];
    return 0;
  }
  if (j == 3) {
    cout << a[0] + a[1] + a[2] + a[3];
    return 0;
  }
  vector<long long> v;
  v.push_back(a[0]);
  v.push_back(a[1]);
  v.push_back(a[2]);
  v.push_back(a[3]);
  dfs(0, v);
  cout << ans << endl;
  return 0;
}
