#include <bits/stdc++.h>
using namespace std;
int arr[5];
bool flag[5];
char ch[5][4];
long long solve(vector<long long> vec, int ind) {
  if (ind == 2) {
    if (ch[ind][0] == '*') return vec[0] * vec[1];
    return vec[0] + vec[1];
  }
  long long ret = 1LL << 60;
  vector<long long> vec2;
  int c, c2;
  for (c = 0; c < vec.size(); c++)
    for (c2 = c + 1; c2 < vec.size(); c2++) {
      long long t;
      if (ch[ind][0] == '*')
        t = vec[c] * vec[c2];
      else
        t = vec[c] + vec[c2];
      vec2.clear();
      for (int c3 = 0; c3 < vec.size(); c3++)
        if (c3 != c && c3 != c2) vec2.push_back(vec[c3]);
      vec2.push_back(t);
      ret = min(ret, solve(vec2, ind + 1));
    }
  return ret;
}
int main() {
  FILE *in = stdin;
  int c, c2;
  vector<long long> vec;
  for (c = 0; c < 4; c++) {
    fscanf(in, "%d", &arr[c]);
    vec.push_back((long long)arr[c]);
  }
  sort(arr, arr + 4);
  long long ret = 0;
  for (c = 0; c < 3; c++) fscanf(in, "%s", ch[c]);
  ret = solve(vec, 0);
  printf("%I64d\n", ret);
  return 0;
}
