#include <bits/stdc++.h>
using namespace std;
long long a[5];
char x[4];
long long res = 1e14;
inline long long calc(long long x, long long y, char xx) {
  if (xx == '*') return x * y;
  return x + y;
}
int main() {
  register int i, j;
  for (i = 1; i <= 4; i++) cin >> a[i];
  for (i = 1; i <= 3; i++) cin >> x[i];
  int f[5] = {0, 1, 2, 3, 4};
  do {
    long long A = calc(a[f[1]], a[f[2]], x[1]);
    long long B = calc(A, a[f[3]], x[2]);
    long long T1 = calc(B, a[f[4]], x[3]);
    A = calc(a[f[1]], a[f[2]], x[1]);
    B = calc(a[f[3]], a[f[4]], x[2]);
    long long T2 = calc(A, B, x[3]);
    res = min(res, min(T1, T2));
  } while (next_permutation(f + 1, f + 5));
  cout << res;
  return 0;
}
