#include <bits/stdc++.h>
using namespace std;
void print_vector(vector<long long> vt) {
  for (auto v : vt) {
    cout << v;
  }
  cout << endl;
}
int main() {
  int priceA, priceB, priceAB, Anum, Bnum;
  cin >> priceA >> priceB >> priceAB >> Anum >> Bnum;
  long long ans = 10000000000;
  for (int ab = 0; ab / 2 <= max(Anum, Bnum); ab += 2) {
    ans = min(ans, long long(ab * priceAB + (Anum - ab * 0.5) * priceA +
                             (Bnum - ab * 0.5) * priceB));
  }
  cout << ans << endl;
  return 0;
}
