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