#include <bits/stdc++.h>
using namespace std;
const int inf = 2147483647, dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
const int N = 100005, M = 1000005, mod = 1000000007;
const long long llinf = 9223372036854775807ll;
long long ans, a, b, c, d;
char ch[3];
void go2(long long aa, long long bb) {
  if (ch[2] == '+')
    ans = min(ans, aa + bb);
  else
    ans = min(ans, aa * bb);
}
void go1(long long aa, long long bb, long long cc) {
  if (ch[1] == '+') {
    go2(aa + bb, cc);
    go2(aa + cc, bb);
    go2(bb + cc, aa);
  } else {
    go2(aa * bb, cc);
    go2(aa * cc, bb);
    go2(bb * cc, aa);
  }
}
void go(long long aa, long long bb, long long cc, long long dd) {
  if (ch[0] == '+') {
    go1(aa + bb, cc, dd);
    go1(aa + cc, bb, dd);
    go1(aa + dd, bb, cc);
    go1(bb + cc, aa, dd);
    go1(bb + dd, aa, cc);
    go1(cc + dd, aa, bb);
  } else {
    go1(aa * bb, cc, dd);
    go1(aa * cc, bb, dd);
    go1(aa * dd, bb, cc);
    go1(bb * cc, aa, dd);
    go1(bb * dd, aa, cc);
    go1(cc * dd, aa, bb);
  }
}
int main() {
  ans = 1000000000005;
  cin >> a >> b >> c >> d >> ch[0] >> ch[1] >> ch[2];
  go(a, b, c, d);
  cout << ans;
  return 0;
}
