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