#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, x, y, ans;
  cin >> a >> b >> c >> x >> y;
  for (int i = 1; i <= min(x, y); i++) {
    if (i == 1) {
      ans = a * (x - i) + b * (y - i) + c * 2 * i;
    }
    if (a * (x - i) + b * (y - i) + c * 2 * i <= ans) {
      ans = a * (x - i) + b * (y - i) + c * 2 * i;
    }
  }
  cout << ans << endl;
}
