#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<ll>;
using Graph = vector<vector<ll>>;
ll ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
int main() {
  ll a, b, prec, x, y;
  cin >> a >> b >> prec >> x >> y;
  ll c = 2 * prec;
  ll ans = 0;
  ll ANS = 99999999999ll;
  for (ll i = 0; i < 100000; i++) {
    ans += c * i;
    if (x > i) ans += (x - i) * a;
    if (y > i) ans += (y - i) * b;
    ANS = min(ANS, ans);
    ans = 0;
  }
  cout << ANS << endl;
}
