#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C, X, Y, mi;
  cin >> A >> B >> C >> X >> Y;
  for (int i = 0; i <= max({X, Y}); i = i + 2) {
    int price = C * i + (2 * X - i) * A / 2 + (2 * Y - i) * B / 2;
    int mi = min({mi, price});
  }
  cout << mi << endl;
  return 0;
}
