#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  long long cost = 1000000000;
  for (int ab = 0; ab <= 200000; ab += 2) {
    cost = min(cost, (ll)2 * c * ab + a * max(0, x - ab) + b * max(0, y - ab));
  }
  cout << cost << endl;
}
