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