#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int INF = 2e9;
const long long INF64 = 1e18;
const double EPS = 1e-12;
const double PI = 3.1415926535897932384626433832795028841;
const long long MD = 925262732;
const long long T = 634521;
const int N = 200010;
const int M = 100;
long long a[4], mini = INF64;
char s[N];
void rec(long long b[4], int t) {
  if (t == 0) {
    for (int i = 0; i < int(4); i++) mini = min(mini, b[i]);
    return;
  }
  for (int i = 0; i < 4; i++)
    for (int j = i + 1; j < 4; j++)
      if (b[i] != INF64 && b[j] != INF64) {
        long long bb[4];
        for (int u = 0; u < int(4); u++) bb[u] = b[u];
        if (s[t - 1] == '+') {
          bb[i] = b[i] + b[j];
          bb[j] = INF64;
          rec(bb, t - 1);
        } else {
          bb[i] = b[i] * b[j];
          bb[j] = INF64;
          rec(bb, t - 1);
        }
      }
}
int main() {
  for (int i = 0; i < int(4); i++) cin >> a[i];
  for (int i = 0; i < int(3); i++) cin >> s[i];
  reverse(s, s + 3);
  rec(a, 3);
  cout << mini;
  return 0;
}
