#include <bits/stdc++.h>
using namespace std;
int a, b, c, d;
char c1, c2, c3;
long long mx = ((long long)1e13);
void two(long long x, long long y) {
  long long a = 0;
  if (c1 == '+')
    a = x + y;
  else
    a = x * y;
  if (mx > a) mx = a;
}
void three(long long x, long long y, long long z) {
  if (c2 == '+') {
    two(x + y, z);
    two(x + z, y);
    two(y + z, x);
  } else {
    two(x * y, z);
    two(x * z, y);
    two(y * z, x);
  }
}
void four(long long x, long long y, long long z, long long b) {
  if (c3 == '+') {
    three(x + y, z, b);
    three(x + z, y, b);
    three(x + b, y, z);
    three(y + z, x, b);
    three(y + b, x, z);
    three(z + b, x, y);
  } else {
    three(x * y, z, b);
    three(x * z, y, b);
    three(x * b, y, z);
    three(y * z, x, b);
    three(y * b, x, z);
    three(z * b, x, y);
  }
}
int main() {
  cin >> a >> b >> c >> d >> c3 >> c2 >> c1;
  four(a, b, c, d);
  cout << mx << endl;
  return 0;
}
