#include <bits/stdc++.h>
using namespace std;
int arr[98];
int main() {
  string s;
  vector<long long> v(4);
  for (int i = 0; i < 4; i++) cin >> v[i];
  sort(v.begin(), v.end());
  char c1, c2, c3;
  cin >> c1 >> c2 >> c3;
  if (c1 == '*' && c2 == '*' && c3 == '*')
    cout << v[0] * v[1] * v[2] * v[3] << endl;
  else if (c1 == '+' && c2 == '+' && c3 == '+')
    cout << v[0] + v[1] + v[2] + v[3] << endl;
  else if (c1 == '*' && c2 == '+' && c3 == '+') {
    if (c1 == 0) cout << (v[0] * v[3]) + v[1] + v[2] << endl;
    cout << (v[0] * v[1]) + v[2] + v[3] << endl;
  } else if (c1 == '*' && c2 == '*' && c3 == '+')
    cout << min(min((v[0] * v[1] * v[2]) + v[3], (v[0] * v[1]) + (v[2] * v[3])),
                (v[0] * v[3]) + (v[1] * v[2]))
         << endl;
  else if (c1 == '+' && c2 == '*' && c3 == '*')
    cout << (v[2] + v[3]) * v[0] * v[1] << endl;
  else if (c1 == '+' && c2 == '+' && c3 == '*')
    cout << (v[1] + v[2] + v[3]) * v[0] << endl;
  else if (c1 == '+' && c2 == '*' && c3 == '+')
    cout << (v[0] * v[1]) + v[2] + v[3] << endl;
  else if (c1 == '*' && c2 == '+' && c3 == '*')
    cout << (((v[1] * v[2]) + v[3]) * v[0]) << endl;
  return 0;
}
