#include <bits/stdc++.h>
using namespace std;
string s1, s2, s3;
unsigned long long int answer = 18446744073709551615;
void solve2(unsigned long long int a, unsigned long long int b) {
  if (s3 == "+") {
    unsigned long long int x = a + b;
    if (x < answer) answer = x;
  } else {
    unsigned long long int x = a * b;
    if (x < answer) answer = x;
  }
}
void solve(unsigned long long int a, unsigned long long int b,
           unsigned long long int c) {
  if (s2 == "+") {
    solve2(a + b, c);
    solve2(a + c, b);
    solve2(b + c, a);
  } else {
    solve2(a * b, c);
    solve2(a * c, b);
    solve2(b * c, a);
  }
}
int main() {
  unsigned long long int a, b, c, d;
  cin >> a >> b >> c >> d;
  cin >> s1 >> s2 >> s3;
  if (s1 == "+") {
    solve(a + b, c, d);
    solve(a + c, b, d);
    solve(a + d, b, c);
    solve(b + c, a, d);
    solve(b + d, a, c);
    solve(c + d, a, b);
  } else {
    solve(a * b, c, d);
    solve(a * c, b, d);
    solve(a * d, b, c);
    solve(b * c, a, d);
    solve(b * d, a, c);
    solve(c * d, a, b);
  }
  cout << answer;
  return 0;
}
