#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll Mod = 1000000007;
int main() {
  ll A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  ll ans = 9999999999999999;
  for (int i = 0; i <= max(X, Y) + 4; i++) {
    ll res = (A * (X - i)) + (B * (Y - i)) + (C * (i * 2));
    ans = min(ans, res);
  }
  cout << ans << endl;
  return 0;
}
