#include <bits/stdc++.h>
using namespace std;
int countPrise(int divA, int divB, int divC, int priseA, int priseB,
               int priseC) {
  return divA * priseA + divB * priseB + divC * priseC;
}
int main() {
  int A, B, C, X, Y, i, prise;
  int min = 10000000;
  cin >> A >> B >> C >> X >> Y;
  for (i = 0; i <= 2 * max(X, Y); i += 2) {
    prise = countPrise(max(0, X - i / 2), max(0, Y - i / 2), i, A, B, C);
    if (min > prise) {
      min = prise;
    }
  }
  cout << min << endl;
  return 0;
}
