#include <bits/stdc++.h>
int main(void) {
  int a, b, c, x, y;
  scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);
  int i = 0, lowcost = 1 << 30;
  while (i <= 200000) {
    int cost = 2 * c * i;
    cost += 0 > a * (x - i) ? 0 : a * (x - i);
    cost += 0 > b * (y - i) ? 0 : b * (y - i);
    if (cost < lowcost) {
      lowcost = cost;
    }
    i += 2;
  }
  printf("%d\n", lowcost);
}
