#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
void dbg() { cerr << "\n"; }
template <typename T, typename... T2>
void dbg(const T& fst, const T2&... rst) {
  cerr << fst << ": ";
  dbg(rst...);
}
int main() {
  long long a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  long long ans = a * x + b * y;
  vector<int> ss;
  for (int(i) = 0; (i) < (x + y + 1); (i)++) {
    long long w =
        max(0LL, a * (x - i)) + max(0LL, b * (y - i)) + max(0LL, c * i * 2);
    ans = min(ans, w);
  }
  cout << ans << "\n";
  return 0;
}
