#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<vector<int>> vvi;
typedef vector<vector<double>> vvd;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvld;
typedef vector<pair<int, int>> vi_i;
typedef vector<pair<double, double>> vd_d;
typedef vector<pair<ll, ll>> vl_l;
typedef vector<pair<ld, ld>> vld_ld;
typedef vector<string> vs;
typedef pair<int, int> i_i;
typedef pair<double, double> d_d;
typedef pair<ll, ll> l_l;
typedef pair<ld, ld> ld_ld;
stringstream ss;
stringstream init_ss;
struct ToUpper {
  char operator()(char c) { return toupper(c); }
};
struct ToLower {
  char operator()(char c) { return tolower(c); }
};
void Main(void) {
  ll a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  ll ans;
  if (a + b < 2 * c) {
    ans = a * x + b * y;
  } else {
    ll cn = min(x, y);
    ans = 2 * c * cn + a * abs(x - cn) + b * abs(y - cn);
    if (2 * c < a || 2 * c < b) {
      ll ch = max(x, y);
      ans = 2 * c * ch;
    }
  }
  cout << ans << endl;
}
int main(int argc, char const *argv[]) {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
  return 0;
}
