#include <bits/stdc++.h>
using namespace std;
int n, v[10];
long long a[10], ans = 1e15;
char ch[10];
void dfs(int s) {
  if (s == 3) {
    for (int i = 1; i <= 4; i++) {
      if (!v[i]) ans = min(ans, a[i]);
    }
  }
  for (int i = 1; i <= 4; i++) {
    if (v[i]) continue;
    for (int j = i + 1; j <= 4; j++) {
      if (v[j]) continue;
      long long tem = a[i];
      if (ch[s] == '*')
        a[i] = a[i] * a[j];
      else
        a[i] = a[i] + a[j];
      v[j] = 1;
      dfs(s + 1);
      a[i] = tem;
      v[j] = 0;
    }
  }
}
int main() {
  for (int i = 1; i <= 4; i++) cin >> a[i];
  for (int i = 0; i < 3; i++) cin >> ch[i];
  dfs(0);
  cout << ans << endl;
  return 0;
}
