#include <bits/stdc++.h>
using namespace std;
long long arr[4];
char op[3];
long long operation1() {
  long long result = 0;
  if (op[0] == '+')
    result = arr[0] + arr[1];
  else
    result = arr[0] * arr[1];
  if (op[1] == '+')
    result += arr[2];
  else
    result *= arr[2];
  if (op[2] == '+')
    result += arr[3];
  else
    result *= arr[3];
  return result;
}
long long operation2() {
  long long result1 = 0, result2 = 0;
  if (op[0] == '+')
    result1 = arr[0] + arr[1];
  else
    result1 = arr[0] * arr[1];
  if (op[2] == '+')
    result2 = arr[2] + arr[3];
  else
    result2 = arr[2] * arr[3];
  if (op[1] == '+')
    result1 += result2;
  else
    result1 *= result2;
  return result1;
}
long long operation3() {
  long long result = 0;
  if (op[1] == '+')
    result = arr[2] + arr[3];
  else
    result = arr[2] * arr[3];
  if (op[2] == '+')
    result += arr[1];
  else
    result *= arr[1];
  if (op[0] == '+')
    result += arr[0];
  else
    result *= arr[0];
  return result;
}
long long operation4() {
  long long result1 = 0, result2 = 0;
  if (op[0] == '+')
    result1 = arr[0] + arr[3];
  else
    result1 = arr[0] * arr[3];
  if (op[2] == '+')
    result2 = arr[2] + arr[1];
  else
    result2 = arr[2] * arr[1];
  if (op[1] == '+')
    result1 += result2;
  else
    result1 *= result2;
  return result1;
}
long long fun(long long a, long long b, char op) {
  return (op == '*') ? a * b : a + b;
}
int main() {
  long long answer = 100000000000000000;
  cin >> arr[0] >> arr[1] >> arr[2] >> arr[3];
  cin >> op[0] >> op[1] >> op[2];
  sort(arr, arr + 4);
  do {
    answer = min(answer, fun(fun(arr[0], arr[1], op[0]),
                             fun(arr[2], arr[3], op[1]), op[2]));
    answer = min(answer, fun(fun(fun(arr[0], arr[1], op[0]), arr[2], op[1]),
                             arr[3], op[2]));
  } while (next_permutation(arr, arr + 4));
  cout << answer << endl;
  return 0;
}
