#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, ans = 0x3f3f3f3f3f3f3f3f;
string s[10];
long long calculate(long long a, long long b, long long o) {
  if (s[o][0] == '+') {
    return a + b;
  } else {
    return a * b;
  }
}
void dfs3(long long a, long long b) { ans = min(ans, calculate(a, b, 3)); }
void dfs2(long long a, long long b, long long c) {
  dfs3(calculate(a, b, 2), c);
  dfs3(calculate(a, c, 2), b);
  dfs3(calculate(b, c, 2), a);
}
void dfs1(long long a, long long b, long long c, long long d) {
  dfs2(calculate(a, b, 1), c, d);
  dfs2(calculate(a, c, 1), b, d);
  dfs2(calculate(a, d, 1), b, c);
  dfs2(calculate(b, c, 1), a, d);
  dfs2(calculate(b, d, 1), a, c);
  dfs2(calculate(c, d, 1), a, b);
}
int main() {
  cin >> a >> b >> c >> d >> s[1] >> s[2] >> s[3];
  dfs1(a, b, c, d);
  cout << ans;
  return 0;
}
