#include <bits/stdc++.h>
const int inf = 2e9;
using namespace std;
int main() {
  int a, b, c, na, nb;
  scanf("%d%d%d%d%d", &a, &b, &c, &na, &nb);
  long long mi = 1000000000000000001;
  int ca, cb;
  int tope = max(na, nb);
  for (int i = 0; i <= tope; i += 2) {
    ca = na - i;
    cb = nb - i;
    if (na - i < 0) ca = 0;
    if (nb - i < 0) cb = 0;
    mi = min(mi, long long(long long(i * c * 2) + long long(ca * a) +
                           long long(cb * b)));
  }
  return !printf("%lld", mi);
}
