#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int price = A * X + B * Y, x;
  for (int Z = 1; Z <= 10 * 10 * 10 * 10 * 10; Z++) {
    x = Z * 2 * C + max(0, X - Z) * A + max(0, Y - Z) * B;
    x = min(price, x);
  }
  cout << price << endl;
}
