#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y, price, chpst = 10000000000;
  cin >> a >> b >> c >> x >> y;
  for (int i = 0; i <= min(x, y); i++) {
    price = a * x + b * y + i * (2 * c - a - b);
    chpst = min(chpst, price);
  }
  for (int i = min(x, y) + 1; i <= max(x, y); i++) {
    price += (2 * c - max(a, b));
    chpst = min(chpst, price);
  }
  cout << chpst;
  return 0;
}
