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