#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  long long m = 999999999999;
  for (int c = 0;; c += 2) {
    int a = max(0, X - c / 2);
    int b = max(0, Y - c / 2);
    if (a == 0 && b == 0) {
      break;
    }
    long long cost = a * A + b * B + c * C;
    m = min(m, cost);
  }
  cout << m << endl;
}
