#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  long long yen = A * X + B * Y;
  long long m = yen;
  if (X < Y) {
    for (int i = 0; i < X; ++i) {
      yen = yen - A - B + 2 * C;
      m = min(m, yen);
    }
    for (int i = 0; i < Y; ++i) {
      yen = yen - B + 2 * C;
      m = min(m, yen);
    }
  } else {
    for (int i = 0; i < Y; ++i) {
      yen = yen - A - B + 2 * C;
      m = min(m, yen);
    }
    for (int i = 0; i < X; ++i) {
      yen = yen - A + 2 * C;
      m = min(m, yen);
    }
  }
  cout << m << endl;
}
