#include <bits/stdc++.h>
using namespace std;
char s[4];
long long a, b, c, d;
long long func2(long long a, long long b) {
  if (s[2] == '+') return a + b;
  return a * b;
}
long long func3(long long a, long long b, long long c) {
  long long ans = 1LL << 50;
  if (s[1] == '+') {
    ans = min(ans, func2(a + b, c));
    ans = min(ans, func2(a + c, b));
    ans = min(ans, func2(b + c, a));
  } else {
    ans = min(ans, func2(a * b, c));
    ans = min(ans, func2(a * c, b));
    ans = min(ans, func2(b * c, a));
  }
  return ans;
}
long long func4(long long a, long long b, long long c, long long d) {
  long long ans = 1LL << 50;
  if (s[0] == '+') {
    ans = min(ans, func3(a + b, c, d));
    ans = min(ans, func3(a + c, b, d));
    ans = min(ans, func3(a + d, b, c));
    ans = min(ans, func3(b + c, a, d));
    ans = min(ans, func3(b + d, a, c));
    ans = min(ans, func3(c + d, a, b));
  } else {
    ans = min(ans, func3(a * b, c, d));
    ans = min(ans, func3(a * c, b, d));
    ans = min(ans, func3(a * d, b, c));
    ans = min(ans, func3(b * c, a, d));
    ans = min(ans, func3(b * d, a, c));
    ans = min(ans, func3(c * d, a, b));
  }
  return ans;
}
int main(void) {
  cin >> a >> b >> c >> d;
  for (int i = 0; i < 3; i++) cin >> s[i];
  long long ans = func4(a, b, c, d);
  cout << ans;
  return 0;
}
