#include <bits/stdc++.h>
int main(void) {
  int a, b, c, x, y, min_price, nx, ny;
  scanf("%d %d %d %d %d[^\n]", &a, &b, &c, &x, &y);
  if (a < 1 || a > 5000 || b < 1 || b > 5000 || c < 1 || c > 5000 || x < 1 ||
      x > 100000 || y < 1 || y > 100000)
    return -1;
  if (x >= y) {
    min_price = (a + b <= 2 * c) ? (a + b) * (y / 2) * 2 : 4 * c * (y / 2);
    nx = x - (y / 2) * 2;
    ny = y % 2;
    min_price = a * nx + b * ny + min_price;
    min_price = (min_price <= 4 * c * ((x + 1) / 2)) ? min_price
                                                     : 4 * c * ((x + 1) / 2);
  } else {
    min_price = (a + b <= 2 * c) ? (a + b) * (x / 2) * 2 : 4 * c * (x / 2);
    ny = y - (x / 2) * 2;
    nx = x % 2;
    min_price = a * nx + b * ny + min_price;
    min_price = (min_price <= 4 * c * ((y + 1) / 2)) ? min_price
                                                     : 4 * c * ((y + 1) / 2);
  }
  printf("%d\n", min_price);
  return 0;
}
