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