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