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