#include <bits/stdc++.h>
using namespace std;
string yn(bool x) { return x ? "Yes" : "No"; }
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int res = a * x + b * y;
  for (int i = 0; i <= min(x, y) * 2; i += 2) {
    int price = a * (x - i / 2) + b * (y - i / 2) + c * i;
    res = min(res, price);
  }
  cout << res << endl;
}
