#include <bits/stdc++.h>
using namespace std;
int a, b, c, x, y;
long long solve() {
  long long ans = 1 << 29;
  for (long long i = 0; i <= 1000000; ++i)
    ans = min(ans, max(x - i, 0LL) * a + max(y - i, 0LL) * b + 2 * i * c);
  return ans;
}
int main() {
  cin >> a >> b >> c >> x >> y;
  cout << solve() << endl;
}
