#include <bits/stdc++.h>
int main() {
  int a, b, c, x, y, t1, t2, t3, min, lmin, lmax, rem, xi, yi, i;
  scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);
  min = x * a + y * b;
  if (x > y) {
    lmax = x;
    lmin = y;
    rem = (x - y) * a;
  } else {
    lmax = y;
    lmin = x;
    rem = (y - x) * b;
  }
  if ((2 * lmax * c) < min)
    min = 2 * lmax * c;
  else if (((2 * lmin * c) + rem) < min)
    min = (2 * lmin * c) + rem;
  else {
    for (i = 0; i < lmin; i++) {
      xi = x - i;
      yi = y - i;
      if ((2 * c * (x + y - 2 * i) + xi * a + yi * b) < min)
        min = 2 * c * (x + y - 2 * i) + xi * a + yi * b;
    }
  }
  printf("%d", min);
}
