#include <bits/stdc++.h>
using namespace std;
char ch[4];
long long minn = 9999999999999999;
void f2(long long a, long long b) {
  long long c = (ch[2] == '+' ? a + b : a * b);
  minn = min(minn, c);
}
void f3(long long a, long long b, long long c) {
  if (ch[1] == '+') {
    f2(a + b, c);
    f2(a + c, b);
    f2(b + c, a);
  } else {
    f2(a * b, c);
    f2(a * c, b);
    f2(b * c, a);
  }
}
void f4(long long a, long long b, long long c, long long d) {
  if (ch[0] == '+') {
    f3(a + b, c, d);
    f3(a + c, b, d);
    f3(a + d, b, c);
    f3(b + c, a, d);
    f3(b + d, a, c);
    f3(c + d, a, b);
  } else {
    f3(a * b, c, d);
    f3(a * c, b, d);
    f3(a * d, b, c);
    f3(b * c, a, d);
    f3(b * d, a, c);
    f3(c * d, a, b);
  }
}
int main() {
  long long a[5];
  for (int i = 1; i <= 4; i++) cin >> a[i];
  for (int i = 0; i < 3; i++) cin >> ch[i];
  f4(a[1], a[2], a[3], a[4]);
  cout << minn;
  return 0;
}
