#include <bits/stdc++.h>
using namespace std;
struct p {
  int h;
  int w;
  int n;
  bool flag = false;
};
int main() {
  ios::sync_with_stdio(false);
  int totalValue = 0;
  int commonPart, Apart, Bpart;
  int priceA, priceB, priceMix;
  scanf("%d%d%d", &priceA, &priceB, &priceMix);
  scanf("%d%d", &Apart, &Bpart);
  commonPart = (Apart < Bpart ? Apart : Bpart);
  if (2 * priceMix < priceA + priceB) {
    totalValue = priceMix * 2 * commonPart;
  } else {
    totalValue = commonPart * (priceA + priceB);
  }
  if ((Apart - commonPart) * priceA + (Bpart - commonPart) * priceB <
      (Apart - commonPart + Bpart - commonPart) * priceMix * 2) {
    totalValue += (Apart - commonPart) * priceA + (Bpart - commonPart) * priceB;
  } else {
    totalValue += (Apart - commonPart + Bpart - commonPart) * priceMix * 2;
  }
  printf("%d\n", totalValue);
  return 0;
}
