#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int limit = max(X, Y) * 2;
  long long int budget = 1000000000;
  for (int c = 0; c <= limit; c += 2) {
    long long int tmp = A * (X - c / 2) + B * (Y - c / 2) + c * C;
    budget = min(budget, tmp);
  }
  cout << budget;
}
