#include <bits/stdc++.h>
using namespace std;
int iceil(int a) { return (int)ceil((float)a / 2) * 2; }
int solvea(int a, int b, int c, int x, int y) {
  return min(iceil(y) * 2 * c, y / 2 * 4 * c + b);
}
int solveb(int a, int b, int c, int x, int y) {
  return min(iceil(x) * 2 * c + (y - iceil(x)) * b,
             x / 2 * 4 * c + a * (x - x / 2 * 2) + (y - x / 2 * 2) * b);
}
int solvec(int a, int b, int c, int x, int y) { return a * x + b * y; }
int main(void) {
  int a, b, c, x, y;
  scanf("%d %d %d %d %d", &a, &b, &c, &x, &y);
  if (x > y) {
    swap(a, b);
    swap(x, y);
  }
  printf("%d\n", min({solvea(a, b, c, x, y), solveb(a, b, c, x, y),
                      solvec(a, b, c, x, y)}));
  return 0;
}
