#include <bits/stdc++.h>
using namespace std;
long long a[5];
char s[5];
long long dfs1(long long a, long long b, long long c) {
  if (s[1] == '+' && s[2] == '*')
    return min({(a + b) * c, (a + c) * b, (b + c) * a});
  else if (s[1] == '+' && s[2] == '+')
    return a + b + c;
  else if (s[1] == '*' && s[2] == '+')
    return min({a * b + c, a * c + b, b * c + a});
  return a * b * c;
}
long long dfs2(long long a, long long b, long long c, long long d) {
  if (s[0] == '+')
    return min({dfs1(a + b, c, d), dfs1(a + c, b, d), dfs1(a + d, b, c),
                dfs1(b + c, a, d), dfs1(b + d, a, c), dfs1(c + d, a, b)});
  return min({dfs1(a * b, c, d), dfs1(a * c, b, d), dfs1(a * d, b, c),
              dfs1(b * c, a, d), dfs1(b * d, a, c), dfs1(c * d, a, b)});
}
int main() {
  for (int i = 0; i < 4; i++) cin >> a[i];
  for (int i = 0; i < 3; i++) cin >> s[i];
  cout << dfs2(a[0], a[1], a[2], a[3]) << "\n";
  return 0;
}
