#include <bits/stdc++.h>
int take() {
  int n;
  scanf("%d", &n);
  return n;
}
double ttake() {
  double n;
  scanf("%lf", &n);
  return n;
}
long long takes() {
  long long n;
  scanf("%lld", &n);
  return n;
}
int cas;
using namespace std;
bool approximatelyEqual(float a, float b, float epsilon) {
  return fabs(a - b) <= ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
bool essentiallyEqual(float a, float b, float epsilon) {
  return fabs(a - b) <= ((fabs(a) > fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
bool definitelyGreaterThan(float a, float b, float epsilon) {
  return (a - b) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
bool definitelyLessThan(float a, float b, float epsilon) {
  return (b - a) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
int main() {
  long long a = takes(), b = takes(), c = takes(), x = takes(), y = takes();
  long long ans = 1000000000000000000;
  for (int i = 0; i <= x; i += 1) {
    for (int k = 0; k <= y; k += 1) {
      long long d = i, e = k;
      long long f = d * a + e * b;
      long long g = max(x - i, y - k) * 2ll * c;
      ans = min(ans, f + g);
    }
  }
  printf("%lld\n", ans);
  { return 0; };
}
