#include <bits/stdc++.h>
using namespace std;
long long a[5], ans = LLONG_MAX;
char b[4];
bool vis[5];
void dfs(int x) {
  int i, j;
  if (x > 3) {
    for (i = 1; i <= 4; i++)
      if (!vis[i]) ans = min(ans, a[i]);
    return;
  }
  for (i = 1; i <= 4; i++) {
    for (j = 1; j <= 4; j++) {
      if (i == j || vis[i] || vis[j]) continue;
      long long p = a[i];
      vis[j] = true;
      if (b[x] == '+')
        a[i] += a[j];
      else if (b[x] == '*')
        a[i] *= a[j];
      dfs(x + 1);
      vis[j] = false;
      a[i] = p;
    }
  }
}
int main() {
  for (int i = 1; i <= 4; i++) cin >> a[i];
  for (int i = 1; i <= 3; i++) cin >> b[i];
  dfs(1);
  cout << ans;
  return 0;
}
