#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[4];
  char c[3];
  for (int j = 0; j < 4; j++) cin >> a[j];
  for (int j = 0; j < 3; j++) cin >> c[j];
  sort(a, a + 4);
  long long ans = 1000000000000;
  do {
    long long x = a[0];
    for (int j = 1; j < 4; j++)
      if (c[j - 1] == '*')
        x *= a[j];
      else
        x += a[j];
    ans = min(ans, x);
    long long y = 0;
    if (c[0] == '*')
      x = a[0] * a[1];
    else
      x = a[0] + a[1];
    if (c[1] == '*')
      y = a[2] * a[3];
    else
      y = a[2] + a[3];
    long long p;
    if (c[2] == '*')
      p = x * y;
    else
      p = x + y;
    ans = min(ans, p);
  } while (next_permutation(a, a + 4));
  cout << ans << endl;
}
