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