#include <bits/stdc++.h>
using namespace std;
char f1, f2, f3;
long long ans = (1e13);
void choose_two(long long a, long long b) {
  if (f3 == '+') {
    ans = min(ans, a + b);
  } else {
    ans = min(ans, a * b);
  }
}
void choose_three(long long a, long long b, long long c) {
  if (f2 == '+') {
    choose_two(a + b, c);
    choose_two(a + c, b);
    choose_two(b + c, a);
  } else {
    choose_two(a * b, c);
    choose_two(a * c, b);
    choose_two(b * c, a);
  }
}
void choose_four(long long a, long long b, long long c, long long d) {
  if (f1 == '+') {
    choose_three(a + b, c, d);
    choose_three(a + c, b, d);
    choose_three(a + d, b, c);
    choose_three(b + c, a, d);
    choose_three(b + d, a, c);
    choose_three(c + d, a, b);
  } else {
    choose_three(a * b, c, d);
    choose_three(a * c, b, d);
    choose_three(a * d, b, c);
    choose_three(b * c, a, d);
    choose_three(b * d, a, c);
    choose_three(c * d, a, b);
  }
}
long long a, b, c, d;
void PrintAns() {
  choose_four(a, b, c, d);
  cout << ans << endl;
  exit(0);
}
int main() {
  cin >> a >> b >> c >> d >> f1 >> f2 >> f3;
  PrintAns();
}
