#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[4], mcnt = 0;
  char c[3];
  for (int i = 0; i < 4; i++) cin >> a[i];
  for (int i = 0; i < 3; i++) {
    cin >> c[i];
    if (c[i] == '*') mcnt++;
  }
  sort(a, a + 4);
  if (!mcnt)
    cout << (a[0] + a[1] + a[2] + a[3]) << endl;
  else if (mcnt == 1) {
    if (c[2] == '*')
      cout << (a[1] + a[2] + a[3]) * a[0] << endl;
    else
      cout << (a[0] * a[1]) + a[2] + a[3] << endl;
  } else if (mcnt == 2) {
    if (c[0] == '+')
      cout << a[0] * a[1] * (a[2] + a[3]) << endl;
    else if (c[1] == '+')
      cout << ((a[1] * a[2]) + a[3]) * a[0] << endl;
    else if (c[2] == '+')
      cout << ((a[0] * a[3]) + (a[1] * a[2])) << endl;
  } else
    cout << (a[0] * a[1] * a[2] * a[3]) << endl;
}
