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