#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vivi = vector<vi>;
using vll = vector<long long>;
using vllvll = vector<vll>;
using vs = vector<string>;
using um = unordered_map<long long, long long>;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
int main() {
  ll A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  ll mn = INF;
  for (long long i = 0; i < X + 1; ++i) {
    ll asum = A * i;
    ll b = i + (Y - X);
    if (b < 0) continue;
    ll bsum = B * b;
    ll c = 2 * (X - i);
    ll csum = C * c;
    ll sm = asum + bsum + csum;
    if (sm < mn) {
      mn = sm;
    }
  }
  cout << mn << endl;
}
