#include <bits/stdc++.h>
using namespace std;
const int n = 4;
long long a[5], x[5], res = 1e19, tmp, y[5];
char f[5];
bool d = false, kt = false;
void nhap() {
  for (int i = (1); i <= (4); ++i) {
    cin >> a[i];
    if (a[i] == 0) d = true;
  }
  for (int i = (1); i <= (4); ++i) x[i] = i;
  for (int i = (1); i <= (3); ++i) {
    cin >> f[i];
    if (f[i] == '*') kt = true;
  }
}
long long is(long long a, long long b, char c) {
  if (c == '*') return a * b;
  return a + b;
}
void solve() {
  if (d && kt) {
    cout << 0;
    return;
  }
  do {
    tmp = is(a[x[1]], a[x[2]], f[1]);
    tmp = min(is(is(tmp, a[x[3]], f[2]), a[x[4]], f[3]),
              is(is(a[x[3]], a[x[4]], f[2]), tmp, f[3]));
    res = min(res, tmp);
  } while (next_permutation(x + 1, x + 5));
  cout << res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  nhap();
  solve();
}
