#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  int b;
  int c;
  int x;
  int y;
  cin >> a >> b >> c >> x >> y;
  int negans = 0;
  for (int s = 0; s <= x; s++) {
    for (int t = 0; t <= y; t++) {
      int u = 2 * max(x - s, y - t);
      int cand = s * a + t * b + u * c;
      if (cand > -1 * negans) negans = -1 * cand;
    }
  }
  cout << -1 * negans << endl;
  return 0;
}
