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