#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int ans = a * x + b * y;
  int z = min(x, y);
  for (int i = z; i > 0; i--) {
    int t = a * (x - i) + b * (y - i) + 2 * c * i;
    ans = min(ans, t);
  }
  cout << ans << endl;
}
