#include <bits/stdc++.h>
const int inf = 2e9;
using namespace std;
int main() {
  int a, b, c, na, nb;
  scanf("%d%d%d%d%d", &a, &b, &c, &na, &nb);
  int mi = inf;
  int tope = max(na, nb);
  for (int i = 0; i <= tope; i += 2) {
    mi = min(mi, (i * c * 2) + (na - i) * a + (nb - i) * b);
  }
  return !printf("%d", mi);
  return 0;
}
