#include <bits/stdc++.h>
using namespace std;
long long ar[5][5], jawab;
char s[5];
void kerja(int depth) {
  if (depth == 4)
    jawab = min(jawab, ar[depth][1]);
  else {
    vector<long long> v;
    long long bla = 0LL;
    for (int i = 1; i <= (4 - depth); i++) {
      for (int j = i + 1; j <= 4 - depth + 1; j++) {
        v.clear();
        if (s[depth] == '+')
          bla = ar[depth][i] + ar[depth][j];
        else
          bla = ar[depth][i] * ar[depth][j];
        for (int k = 1; k < i; k++) v.push_back(ar[depth][k]);
        v.push_back(bla);
        for (int k = i + 1; k <= 4 - depth + 1; k++) {
          if (k == j) continue;
          v.push_back(ar[depth][k]);
        }
        for (int k = 0; k < v.size(); k++) ar[depth + 1][k + 1] = v[k];
        kerja(depth + 1);
      }
    }
  }
}
int main() {
  scanf("%I64d %I64d %I64d %I64d\n", &ar[1][1], &ar[1][2], &ar[1][3],
        &ar[1][4]);
  scanf("%c %c %c", &s[1], &s[2], &s[3]);
  jawab = 1000000000002LL;
  kerja(1);
  printf("%I64d\n", jawab);
  return 0;
}
