#include <bits/stdc++.h>
using namespace std;
long long ans;
long long a[10];
bool mark[10];
char ch[10];
void dfs(int x) {
  int i, j;
  if (x == 0) {
    for (i = 0; i < 4; i++)
      for (j = i + 1; j < 4; j++) {
        if (!mark[i] && !mark[j]) {
          long long tmp;
          if (ch[0] == '+')
            tmp = a[i] + a[j];
          else
            tmp = a[i] * a[j];
          a[4] = tmp;
          mark[i] = mark[j] = true;
          mark[4] = false;
          dfs(x + 1);
          mark[i] = mark[j] = false;
        }
      }
  }
  if (x == 1) {
    for (i = 0; i <= 4; i++)
      for (j = i + 1; j <= 4; j++) {
        if (!mark[i] && !mark[j]) {
          long long tmp;
          if (ch[1] == '+')
            tmp = a[i] + a[j];
          else
            tmp = a[i] * a[j];
          a[5] = tmp;
          mark[5] = false;
          mark[i] = mark[j] = true;
          dfs(x + 1);
          mark[i] = mark[j] = false;
        }
      }
  } else if (x == 2) {
    for (i = 0; i <= 5; i++)
      for (j = i + 1; j <= 5; j++) {
        if (!mark[i] && !mark[j]) {
          long long tmp;
          if (ch[2] == '+')
            tmp = a[i] + a[j];
          else
            tmp = a[i] * a[j];
          if (ans == -1) ans = tmp;
          ans = min(ans, tmp);
        }
      }
  }
}
int main() {
  while (cin >> a[0] >> a[1] >> a[2] >> a[3]) {
    cin >> ch[0] >> ch[1] >> ch[2];
    ans = -1;
    dfs(0);
    cout << ans << endl;
  }
  return 0;
}
