#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int mi = 500000000;
  for (int i = 0; i <= 100000; i = i + 2) {
    int price =
        C * i + max({0, 2 * X - i}) * A / 2 + max({0, 2 * Y - i}) * B / 2;
    mi = min({mi, price});
  }
  cout << mi << endl;
  return 0;
}
