#include <bits/stdc++.h>
int main(void) {
  int priceA, priceB, priceAB;
  int numA, numB;
  int sum_price[4] = {0};
  int min = 100000000;
  scanf("%d %d %d %d %d", &priceA, &priceB, &priceAB, &numA, &numB);
  int i;
  sum_price[0] = (priceA * numA) + (priceB * numB);
  if (numA < numB) {
    sum_price[1] = (priceAB * 2 * numA) + (priceB * (numB - numA));
    sum_price[2] = (priceAB * 2 * numB);
  } else if (numA >= numB) {
    sum_price[1] = (priceAB * 2 * numB) + (priceA * (numA - numB));
    sum_price[2] = (priceAB * 2 * numA);
  }
  for (i = 0; i < 3; i++) {
    if (min > sum_price[i]) {
      min = sum_price[i];
    }
  }
  printf("%d", min);
  return 0;
}
