#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  ll total = 1000000000LL;
  for (int i = 1; i <= 100000; i++) {
    ll temp = 2 * c * i + max(0, x - i) * a + max(0, y - i) * b;
    total = min(total, temp);
  }
  cout << total << endl;
}
