#include <bits/stdc++.h>
long long a, b, c, d;
long long r[100];
long long p[100];
void s1() {
  int i = 1;
  r[i++] = a * b * c + d;
  r[i++] = (a * b + c) * d;
  r[i++] = (a + b) * c * d;
  r[i++] = a * b * d + c;
  r[i++] = (a * b + d) * c;
  r[i++] = (a + b) * d * c;
  r[i++] = a * c * b + d;
  r[i++] = (a * c + b) * d;
  r[i++] = (a + c) * b * d;
  r[i++] = a * c * d + b;
  r[i++] = (a * c + d) * b;
  r[i++] = (a + c) * d * b;
  r[i++] = a * d * b + c;
  r[i++] = (a * d + b) * c;
  r[i++] = (a + d) * b * c;
  r[i++] = a * d * c + b;
  r[i++] = (a * d + c) * b;
  r[i++] = (a + d) * c * b;
  r[i++] = b * a * c + d;
  r[i++] = (b * a + c) * d;
  r[i++] = (b + a) * c * d;
  r[i++] = b * a * d + c;
  r[i++] = (b * a + d) * c;
  r[i++] = (b + a) * d * c;
  r[i++] = b * c * a + d;
  r[i++] = (b * c + a) * d;
  r[i++] = (b + c) * a * d;
  r[i++] = b * c * d + a;
  r[i++] = (b * c + d) * a;
  r[i++] = (b + c) * d * a;
  r[i++] = b * d * a + c;
  r[i++] = (b * d + a) * c;
  r[i++] = (b + d) * a * c;
  r[i++] = b * d * c + a;
  r[i++] = (b * d + c) * a;
  r[i++] = (b + d) * c * a;
  r[i++] = c * a * b + d;
  r[i++] = (c * a + b) * d;
  r[i++] = (c + a) * b * d;
  r[i++] = c * a * d + b;
  r[i++] = (c * a + d) * b;
  r[i++] = (c + a) * d * b;
  r[i++] = c * b * a + d;
  r[i++] = (c * b + a) * d;
  r[i++] = (c + b) * a * d;
  r[i++] = c * b * d + a;
  r[i++] = (c * b + d) * a;
  r[i++] = (c + b) * d * a;
  r[i++] = c * d * a + b;
  r[i++] = (c * d + a) * b;
  r[i++] = (c + d) * a * b;
  r[i++] = c * d * b + a;
  r[i++] = (c * d + b) * a;
  r[i++] = (c + d) * b * a;
  r[i++] = d * a * b + c;
  r[i++] = (d * a + b) * c;
  r[i++] = (d + a) * b * c;
  r[i++] = d * a * c + b;
  r[i++] = (d * a + c) * b;
  r[i++] = (d + a) * c * b;
  r[i++] = d * b * a + c;
  r[i++] = (d * b + a) * c;
  r[i++] = (d + b) * a * c;
  r[i++] = d * b * c + a;
  r[i++] = (d * b + c) * a;
  r[i++] = (d + b) * c * a;
  r[i++] = d * c * a + b;
  r[i++] = (d * c + a) * b;
  r[i++] = (d + c) * a * b;
  r[i++] = d * c * b + a;
  r[i++] = (d * c + b) * a;
  r[i++] = (d + c) * b * a;
}
void s2() {
  int k = 1;
  p[k++] = a * b + c + d;
  p[k++] = (a + b) * c + d;
  p[k++] = (a + b + c) * d;
  p[k++] = a * b + d + c;
  p[k++] = (a + b) * d + c;
  p[k++] = (a + b + d) * c;
  p[k++] = a * c + b + d;
  p[k++] = (a + c) * b + d;
  p[k++] = (a + c + b) * d;
  p[k++] = a * c + d + b;
  p[k++] = (a + c) * d + b;
  p[k++] = (a + c + d) * b;
  p[k++] = a * d + b + c;
  p[k++] = (a + d) * b + c;
  p[k++] = (a + d + b) * c;
  p[k++] = a * d + c + b;
  p[k++] = (a + d) * c + b;
  p[k++] = (a + d + c) * b;
  p[k++] = b * a + c + d;
  p[k++] = (b + a) * c + d;
  p[k++] = (b + a + c) * d;
  p[k++] = b * a + d + c;
  p[k++] = (b + a) * d + c;
  p[k++] = (b + a + d) * c;
  p[k++] = b * c + d + a;
  p[k++] = (b + c) * d + a;
  p[k++] = (b + c + d) * a;
  p[k++] = b * c + a + d;
  p[k++] = (b + c) * a + d;
  p[k++] = (b + c + a) * d;
  p[k++] = b * d + a + c;
  p[k++] = (b + d) * a + c;
  p[k++] = (b + d + a) * c;
  p[k++] = b * d + c + a;
  p[k++] = (b + d) * c + a;
  p[k++] = (b + d + c) * a;
  p[k++] = c * a + b + d;
  p[k++] = (c + a) * b + d;
  p[k++] = (c + a + b) * d;
  p[k++] = c * a + d + b;
  p[k++] = (c + a) * d + b;
  p[k++] = (c + a + d) * b;
  p[k++] = c * b + d + a;
  p[k++] = (c + b) * d + a;
  p[k++] = (c + b + d) * a;
  p[k++] = c * b + a + d;
  p[k++] = (c + b) * a + d;
  p[k++] = (c + b + a) * d;
  p[k++] = c * d + a + b;
  p[k++] = (c + d) * a + b;
  p[k++] = (c + d + a) * b;
  p[k++] = c * d + b + a;
  p[k++] = (c + d) * b + a;
  p[k++] = (c + d + b) * a;
  p[k++] = d * a + b + c;
  p[k++] = (d + a) * b + c;
  p[k++] = (d + a + b) * c;
  p[k++] = d * a + c + b;
  p[k++] = (d + a) * c + b;
  p[k++] = (d + a + c) * b;
  p[k++] = d * b + a + c;
  p[k++] = (d + b) * a + c;
  p[k++] = (d + b + a) * c;
  p[k++] = d * b + c + a;
  p[k++] = (d + b) * c + a;
  p[k++] = (d + b + c) * a;
  p[k++] = d * c + b + a;
  p[k++] = (d + c) * b + a;
  p[k++] = (d + c + b) * a;
  p[k++] = d * c + a + b;
  p[k++] = (d + c) * a + b;
  p[k++] = (d + c + a) * b;
}
int main() {
  while (~scanf("%lld%lld%lld%lld", &a, &b, &c, &d)) {
    char x, y, z;
    int w = 0;
    scanf(" %c %c %c", &x, &y, &z);
    if (x == '*') w++;
    if (y == '*') w++;
    if (z == '*') w++;
    if (w == 3) printf("%lld\n", a * b * c * d);
    if (w == 0) printf("%lld\n", a + b + c + d);
    if (w == 1) {
      s2();
      if (x == '*' && y == '+' && z == '+') {
        long long h = p[1];
        for (int i = 1; i <= 72; i++) {
          if (i % 3 == 1) {
            if (h > p[i]) h = p[i];
          }
        }
        r[73] = a * b + c + d;
        r[74] = a * c + b + d;
        r[75] = a * d + c + b;
        r[76] = b * c + a + d;
        r[77] = d * b + c + a;
        r[78] = c * d + a + b;
        for (int i = 73; i <= 78; i++) {
          if (h > r[i]) h = r[i];
        }
        printf("%lld\n", h);
      }
      if (x == '+' && y == '*' && z == '+') {
        long long h = p[2];
        for (int i = 1; i <= 72; i++) {
          if (i % 3 == 2) {
            if (h > p[i]) h = p[i];
          }
        }
        r[73] = a + b + c * d;
        r[74] = a + c + b * d;
        r[75] = a + d + c * b;
        r[76] = c + b + a * d;
        r[77] = d + b + c * a;
        r[78] = c + d + a * b;
        for (int i = 73; i <= 78; i++) {
          if (h > r[i]) h = r[i];
        }
        printf("%lld\n", h);
      }
      if (x == '+' && y == '+' && z == '*') {
        long long h = p[3];
        for (int i = 1; i <= 72; i++) {
          if (i % 3 == 0) {
            if (h > p[i]) h = p[i];
          }
        }
        r[73] = (a + b) * (c + d);
        r[74] = (a + c) * (b + d);
        r[75] = (a + d) * (c + b);
        r[76] = (b + c) * (a + d);
        r[77] = (d + b) * (c + a);
        r[78] = (c + d) * (a + b);
        for (int i = 73; i <= 78; i++) {
          if (h > r[i]) h = r[i];
        }
        printf("%lld\n", h);
      }
    }
    if (w == 2) {
      s1();
      if (x == '*' && y == '*' && z == '+') {
        long long h = r[1];
        for (int i = 1; i <= 72; i++) {
          if (i % 3 == 1) {
            if (h > r[i]) h = r[i];
          }
        }
        r[73] = a * b + c * d;
        r[74] = a * c + b * d;
        r[75] = a * d + b * c;
        for (int i = 73; i <= 75; i++) {
          if (h > r[i]) h = r[i];
        }
        printf("%lld\n", h);
      }
      if (x == '*' && y == '+' && z == '*') {
        long long h = r[2];
        for (int i = 1; i <= 72; i++) {
          if (i % 3 == 2) {
            if (h > r[i]) h = r[i];
          }
        }
        r[73] = a * b * (c + d);
        r[74] = a * c * (b + d);
        r[75] = a * d * (b + c);
        r[76] = b * c * (a + d);
        r[77] = b * d * (a + c);
        r[78] = c * d * (a + b);
        for (int i = 73; i <= 78; i++) {
          if (h > r[i]) h = r[i];
        }
        printf("%lld\n", h);
      }
      if (x == '+' && y == '*' && z == '*') {
        long long h = r[3];
        for (int i = 1; i <= 72; i++) {
          if (i % 3 == 0) {
            if (h > r[i]) h = r[i];
          }
        }
        r[73] = (a + b) * (c * d);
        r[74] = (a + c) * (b * d);
        r[75] = (a + d) * (c * b);
        r[76] = (c + b) * (a * d);
        r[77] = (d + b) * (c * a);
        r[78] = (c + d) * (a * b);
        for (int i = 73; i <= 78; i++) {
          if (h > r[i]) h = r[i];
        }
        printf("%lld\n", h);
      }
    }
  }
  return 0;
}
