#include <bits/stdc++.h>
using namespace std;
char s[10];
long long ans = 1ll << 60;
void dfs3(long long a, long long b) {
  long long temp = 0;
  if (s[2] == '+')
    temp = a + b;
  else
    temp = a * b;
  ans = min(ans, temp);
}
void dfs2(long long a, long long b, long long c) {
  if (s[1] == '+') {
    dfs3(a + b, c);
    dfs3(a + c, b);
    dfs3(b + c, a);
  } else {
    dfs3(a * b, c);
    dfs3(a * c, b);
    dfs3(b * c, a);
  }
}
void dfs1(long long a, long long b, long long c, long long d) {
  if (s[0] == '+') {
    dfs2(a + b, c, d);
    dfs2(a + c, b, d);
    dfs2(a + d, b, c);
    dfs2(b + d, a, c);
    dfs2(b + c, a, d);
    dfs2(c + d, a, b);
  } else {
    dfs2(a * b, c, d);
    dfs2(a * c, b, d);
    dfs2(a * d, b, c);
    dfs2(b * d, a, c);
    dfs2(b * c, a, d);
    dfs2(c * d, a, b);
  }
}
int main() {
  int a, b, c, d;
  while (scanf("%d%d%d%d", &a, &b, &c, &d) != EOF) {
    cin >> s[0] >> s[1] >> s[2];
    dfs1(a, b, c, d);
    cout << ans << endl;
  }
  return 0;
}
