#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int ans = 5000 * 2 * 1E+5;
  for (int a = 0; a <= X; a++) {
    for (int b = 0; b <= Y; b++) {
      int c = max(2 * (X - a), 2 * (Y - b));
      int cost = a * A + b * B + c * C;
      ans = min(ans, cost);
    }
  }
  cout << ans << endl;
  return 0;
}
