#include <bits/stdc++.h>
int main() {
  int A, B, C, X, Y, Maxchange, i, sum, minsum, x, y;
  scanf("%d%d%d%d%d", &A, &B, &C, &X, &Y);
  Maxchange = X;
  if (X < Y) Maxchange = Y;
  minsum = A * X + B * Y;
  for (i = 0; i < Maxchange + 1; i = i + 1) {
    if ((X - i) < 0) x = 0;
    if ((X - i) >= 0) x = X - i;
    if ((Y - i) < 0) y = 0;
    if ((Y - i) >= 0) y = Y - i;
    sum = A * x + B * y + C * (i * 2);
    printf("%d\n", sum);
    if (minsum > sum) minsum = sum;
  }
  printf("答えは%d\n", minsum);
  return 0;
}
