#include <bits/stdc++.h>
using namespace ::std;
using ll = long long;
int main() {
  int A, B, C, X, Y, a, b, c;
  cin >> A >> B >> C >> X >> Y;
  ll price = 1e15;
  for (ll c = 2 * max(X, Y); c >= 0; c--) {
    a = X - (c / 2);
    b = Y - (c / 2);
    if (a < 0 || b < 0) continue;
    ll tmp = A * a + B * b + C * c;
    price = min(tmp, price);
  }
  cout << price << endl;
  return 0;
}
