#include <bits/stdc++.h>
using namespace std;
long long mn = 100000000000;
string s;
long long OPER(long long a, long long b) {
  if (s[0] == '*') {
    return (a * b);
  } else {
    return (a + b);
  }
}
long long OPER2(long long a, long b) {
  if (s[1] == '*') {
    return (a * b);
  } else {
    return (a + b);
  }
}
long long OPER3(long long a, long long b) {
  if (s[2] == '*') {
    return (a * b);
  } else {
    return (a + b);
  }
}
long long IOI(long long mix, long long c, long long d) {
  long long t = 100000000000;
  t = min(t, OPER3(OPER2(mix, c), d));
  t = min(t, OPER3(OPER2(mix, d), c));
  t = min(t, OPER3(OPER2(c, d), mix));
  return t;
}
long long mag(long long a, long long b, long long c, long long d) {
  long long o = 100000000000;
  o = min(o, IOI(OPER(a, b), c, d));
  o = min(o, IOI(OPER(a, c), b, d));
  o = min(o, IOI(OPER(a, d), c, b));
  o = min(o, IOI(OPER(b, c), a, d));
  o = min(o, IOI(OPER(b, d), a, c));
  o = min(o, IOI(OPER(c, d), b, a));
  return o;
}
void all(long long a, long long b, long long c, long long d) {
  mn = min(mn, mag(a, b, c, d));
  mn = min(mn, mag(a, b, d, c));
  mn = min(mn, mag(a, c, b, d));
  mn = min(mn, mag(a, c, d, b));
  mn = min(mn, mag(a, d, c, b));
  mn = min(mn, mag(a, d, b, c));
}
int main() {
  char p;
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  cin >> p;
  s += p;
  cin >> p;
  s += p;
  cin >> p;
  s += p;
  if (s == "+++") {
    cout << (a + b + c + d);
    return 0;
  }
  if (s == "***") {
    cout << (a * b * c * d);
    return 0;
  }
  all(a, b, c, d);
  swap(a, b);
  all(a, b, c, d);
  swap(a, b);
  swap(a, c);
  all(a, b, c, d);
  swap(a, c);
  swap(a, d);
  all(a, b, c, d);
  swap(a, d);
  cout << mn;
  return 0;
}
