#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main() {
  int A, B, AB, X, Y;
  cin >> A >> B >> AB >> X >> Y;
  ll cost = 0;
  if (AB <= A / 2 && AB <= B / 2) {
    cost = 2 * AB * max(X, Y);
  } else if (AB * 2 <= A + B) {
    ll AB_cost = 2 * AB * min(X, Y);
    ll A_cost = A * max(0, X - Y);
    ll B_cost = B * max(0, Y - X);
    cost = AB_cost + A_cost + B_cost;
  } else {
    cost = A * X + B * Y;
  }
  cout << cost << endl;
}
