#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int a, b, c, x, y;
  int cost;
  cin >> a >> b >> c >> x >> y;
  long Min = a * x + b * y;
  long Mx, My;
  for (int i = 0; i < 100000; i++) {
    Mx = x - i;
    My = y - i;
    if (Mx < 0) Mx = x;
    if (My < 0) My = y;
    cost = 2 * c * i + a * Mx + b * My;
    if (Min > cost) Min = cost;
  }
  cout << cost << endl;
  return 0;
}
