#include <bits/stdc++.h>
using namespace std;
long long a[5], ans = 0x7f7f7f7f7f7f7f7f;
char p[4];
inline void dfs(const int &left) {
  if (left == 1) {
    register long long s;
    for (register int i = 1; i <= 4; i++)
      if (a[i] != -1) {
        s = a[i];
        break;
      }
    ans = (ans < s ? ans : s);
    return;
  }
  for (register int i = 1; i <= 4; i++)
    for (register int j = i + 1; j <= 4; j++) {
      register int k = 4 - left + 1;
      if (a[i] == -1 || a[j] == -1 || p[k] == '-') continue;
      register long long x = a[i], y = a[j];
      register char t = p[k];
      p[k] = '-';
      a[j] = -1;
      if (t == '+')
        a[i] = x + y;
      else
        a[i] = x * y;
      dfs(left - 1);
      a[i] = x;
      a[j] = y;
      p[k] = t;
    }
}
int main() {
  for (register int i = 1; i <= 4; i++) cin >> a[i];
  for (register int i = 1; i <= 3; i++) cin >> p[i];
  dfs(4);
  cout << ans;
  return 0;
}
