#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  long long a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  long long ans = 6000 * 100000;
  long long num_a = 0;
  long long num_b = 0;
  long long must_buy_a = 0;
  long long must_buy_b = 0;
  long long cost = 0;
  int stop = 0;
  for (long long i = max(x, y) * 2; i >= 0; i = i - 2) {
    num_a = i / 2;
    if (stop == 1) cout << "num_a" << num_a << endl;
    num_b = i / 2;
    if (num_a < x) {
      must_buy_a = x - num_a;
      if (stop == 1) cout << "must_buy_a" << must_buy_a << endl;
    }
    if (num_b < y) {
      must_buy_b = y - num_b;
    }
    cost = a * must_buy_a + b * must_buy_b + i * c;
    ans = min(ans, cost);
    if (stop == 1) {
      cout << num_a << ' ' << num_b << endl;
      cout << i << ' ' << must_buy_a << ' ' << must_buy_b << endl;
      stop++;
    }
    num_a = 0;
    num_b = 0;
    must_buy_a = 0;
    must_buy_b = 0;
    cost = 0;
  }
  cout << ans << endl;
}
