#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int x, y;
  cin >> x >> y;
  int mi = 1000000000;
  int n;
  for (int i = 0; i <= 100000; i += 2) {
    n = (i * 2 * c) + (max(0, x - i) * a) + (max(0, y - i) * b);
    if (mi > n) mi = n;
  }
  cout << mi << endl;
  return 0;
}
