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