#include <bits/stdc++.h>
using namespace std;
const long long maxx = 200005;
const int N = 6;
const long long MOD = 998244353;
long long GCD(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return (GCD(b, a % b));
}
bool prdiv(long long x, long long y) {
  if ((x / y) == (double)x / y)
    return true;
  else
    return false;
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int day;
void ZeoN() {
  long long t, i, j, k, m, n, x, y, z, a, b, c, p, flag, sum;
  double xx, yy, zz;
  char cc;
  string s;
  long long arr[4], cnt = 0;
  for (i = 0; i < 4; i++) cin >> arr[i];
  sort(arr, arr + 4);
  char opr[3];
  for (i = 0; i < 3; i++) {
    cin >> opr[i];
    if (opr[i] == '*') cnt++;
  }
  if (arr[0] == 0 && cnt > 0) {
    cout << "0" << endl;
    return;
  }
  if (cnt == 0)
    cout << arr[0] + arr[1] + arr[2] + arr[3] << endl;
  else if (cnt == 1) {
    if (opr[2] == '*')
      cout << arr[0] * (arr[1] + arr[2] + arr[3]);
    else
      cout << arr[0] * arr[1] + arr[2] + arr[3] << endl;
  } else if (cnt == 3)
    cout << arr[0] * arr[1] * arr[2] * arr[3] << endl;
  else {
    if (opr[1] == '+')
      cout << (arr[1] * arr[2] + arr[3]) * arr[0] << endl;
    else if (opr[2] == '+')
      cout << arr[0] * arr[3] + arr[1] * arr[2] << endl;
    else
      cout << ((arr[2] + arr[3]) * arr[0]) * arr[1] << endl;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long test = 1;
  while (test--) {
    cout << fixed << showpoint;
    cout << setprecision(10);
    ZeoN();
  }
  return 0;
}
