#include <bits/stdc++.h>
using namespace std;
const long long int INF = 2147483647;
const long long int MINF = -2147483648;
const long long int LINF = 9223372036854775807;
const long long int MOD = 1000000007;
const double PI = acos(-1);
#pragma GCC optimize("Ofast")
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vlli = vector<long long int>;
using vs = vector<string>;
using ll = long long;
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (T &x : vec) is >> x;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i] << (i + 1 == vec.size() ? "" : "");
  }
  return os;
}
template <typename T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int a, b, c, h, k, n, x, y, w, ans = 0, count = 0;
  string s, t;
  vector<pair<string, pair<long long int, long long int>>> pr;
  cin >> a >> b >> c >> x >> y;
  if (c <= a && c <= b) {
    cout << c * (2 * max(x, y)) << endl;
  } else if (c * 2 <= a + b) {
    k = min(x, y);
    ans = c * (2 * k);
    if (k == x) {
      cout << ans + b * (y - x) << endl;
    } else {
      cout << ans + a * (x - y) << endl;
    }
  } else {
    cout << a * x + b * y << endl;
  }
}
