#include <bits/stdc++.h>
using namespace std;
long long mod(long long a, long long b) {
  long long ret = a % b;
  if (ret < 0) ret += b;
  return ret;
}
long long modpow(long long a, long long b, long long c) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = mod(res * a, c);
    a = mod(a * a, c);
    b >>= 1;
  }
  return res;
}
long long digitcal(long long x) {
  long long n = 0;
  while (x > 0) {
    x /= 10;
    n++;
  }
  return n;
}
int main() {
  long long a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  long long ans = 1e18;
  for (int i = 0; i <= x; i++) {
    long long temp = 0;
    temp += i * a;
    temp += (x - i) * 2 * c;
    temp += max((long long)0, y - (x - i)) * b;
    ans = min(ans, temp);
  }
  cout << ans << endl;
  return 0;
}
