#include <bits/stdc++.h>
using namespace std;
template <class T>
void printvec(const vector<T>& v) {
  for (auto x : v) {
    cout << x << " ";
  }
  cout << endl;
}
template <class T>
void printtree(const vector<vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": ";
    printvec(tree[i]);
  }
}
template <class T, class U>
void printmap(const map<T, U>& mp) {
  for (auto x : mp) {
    cout << x.first << "=>" << x.second << endl;
  }
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1e9;
const long long MOD = 1000000007;
int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  long long a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  long long ans = a * x + b * y;
  for (long long i = min(x, y); i <= max(x, y); i += abs(x - y)) {
    long long now = i * 2 * c;
    now += max(0ll, x - i) * a;
    now += max(0ll, y - i) * b;
    chmin(ans, now);
  }
  cout << ans << endl;
}
