#include <bits/stdc++.h>
using namespace std;
inline long long tavan(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
char c[3];
long long ans = ((long long)1e15);
void calc(vector<long long> v, long long p) {
  if (p == 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> ex;
      for (int q = 0; q < v.size(); q++)
        if (q != i && q != j) ex.push_back(v[q]);
      if (c[p] == '+')
        ex.push_back(v[i] + v[j]);
      else
        ex.push_back(v[i] * v[j]);
      calc(ex, p + 1);
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  vector<long long> v;
  for (int i = 0; i < 4; i++) {
    long long a;
    cin >> a;
    v.push_back(a);
  }
  cin >> c[0] >> c[1] >> c[2];
  calc(v, 0);
  cout << ans;
  return 0;
}
