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