#include <bits/stdc++.h>
using namespace std;
long long a[5];
long long book[5];
string s;
const long long inf = 1e18 + 5;
long long ans;
void dfs(long long p) {
  if (p == 3) {
    for (long long i = 0; i < 4; i++)
      if (!book[i]) ans = min(ans, a[i]);
    return;
  }
  for (long long i = 0; i < 4; i++) {
    for (long long j = 0; j < 4; j++) {
      if (i != j && !book[i] && !book[j]) {
        book[i] = 1;
        long long temp = a[j];
        if (s[p] == '*')
          a[j] *= a[i];
        else
          a[j] += a[i];
        dfs(p + 1);
        a[j] = temp;
        book[i] = 0;
      }
    }
  }
}
int main() {
  for (int i = 0; i < 4; i++) scanf("%lld", &a[i]);
  char ch[2];
  for (int i = 0; i < 3; i++) {
    scanf("%s", ch);
    s += ch[0];
  }
  ans = inf;
  dfs(0);
  printf("%lld\n", ans);
  return 0;
}
