#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using VI = vector<ll>;
static const ll kIntMax = numeric_limits<ll>::infinity();
static const double kFloatMax = numeric_limits<double>::infinity();
vector<ll> vi;
int main() {
  ll a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  if (a + b < c * 2) c = (a + b) / 2;
  ll cc = min(x, y) / 2 * 2;
  cout << cc * c * 2 + (x - cc) * min(a, c * 2) + (y - cc) * min(b, c * 2)
       << endl;
  return 0;
}
