#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, j, divC, prise;
  int min = (A + B) * (X + Y);
  cin >> A >> B >> C >> X >> Y;
  for (i = 0; i <= X; i++) {
    for (j = 0; j <= Y; j++) {
      if (X - i < Y - j)
        divC = 2 * (Y - j);
      else
        divC = 2 * (X - i);
      prise = countPrise(i, j, divC, A, B, C);
      if (prise < min) min = prise;
    }
  }
  cout << min << endl;
  return 0;
}
