#include <bits/stdc++.h>
int main() {
  int a, b, c, needa, needb, money = 0, minneed;
  scanf("%d %d %d %d %d", &a, &b, &c, &needa, &needb);
  if (2 * c < (a + b)) {
    minneed = (needa > needb) ? needb : needa;
    needa -= minneed;
    needb -= minneed;
    money += minneed * c * 2;
  }
  if (needa > 0) {
    if (2 * c < a) {
      money += 2 * c * needa;
    } else {
      money += (a * needa);
      printf("money = %d\n", money);
    }
    needa = 0;
  }
  if (needb > 0) {
    if (2 * c < b) {
      money += 2 * c * needb;
    } else {
      money += b * needb;
    }
    needb = 0;
  }
  printf("%d", money);
  return 0;
}
