#include <bits/stdc++.h>
using namespace std;
const long long MOD = 10000000007;
const int maxn = 1010;
const long long linf = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
long long qpow(long long a, long long b) {
  return b ? ((b & 1) ? a * qpow(a * a % MOD, b >> 1) % MOD
                      : qpow(a * a % MOD, b >> 1)) %
                 MOD
           : 1;
}
long long qpow(long long a, long long b, long long c) {
  return b ? ((b & 1) ? a * qpow(a * a % MOD, b >> 1) % c
                      : qpow(a * a % MOD, b >> 1)) %
                 c
           : 1;
}
inline int ird() {
  register int x = 0, f = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return x * f;
}
inline long long lrd() {
  register long long x = 0, f = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return x * f;
}
int gcd(int a, int b) { return (b > 0) ? gcd(b, a % b) : a; }
long long ans = linf;
long long a[maxn], bb[5];
void dfs_3(long long a, long long b) {
  if (bb[3] == 1)
    ans = min(ans, a * b);
  else
    ans = min(ans, a + b);
}
void dfs_2(long long a, long long b, long long c) {
  if (bb[2] == 1) {
    dfs_3(a * b, c);
    dfs_3(a * c, b);
    dfs_3(b * c, a);
  } else {
    dfs_3(a + b, c);
    dfs_3(a + c, b);
    dfs_3(b + c, a);
  }
}
void dfs_1(long long a, long long b, long long c, long long d) {
  if (bb[1] == 1) {
    dfs_2(a * b, c, d);
    dfs_2(a * c, b, d);
    dfs_2(a * d, c, b);
    dfs_2(b * c, a, d);
    dfs_2(b * d, a, c);
    dfs_2(c * d, a, b);
  } else {
    dfs_2(a + b, c, d);
    dfs_2(a + c, b, d);
    dfs_2(a + d, c, b);
    dfs_2(b + c, a, d);
    dfs_2(b + d, a, c);
    dfs_2(c + d, a, b);
  }
}
int main() {
  for (int i = 1; i <= 4; i++) a[i] = lrd();
  char c;
  int co = 0;
  while (scanf("%c", &c)) {
    if (c == '*')
      bb[++co] = 1;
    else if (c == '+')
      bb[++co] = 2;
    if (co == 3) break;
  }
  sort(a + 1, a + 5);
  dfs_1(a[1], a[2], a[3], a[4]);
  cout << ans << endl;
  return 0;
}
