#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, X, Y;
  cin >> a >> b >> c >> X >> Y;
  long long ans = 1e9;
  for (int x = 0; x <= X; x++) {
    for (int y = 0; y <= Y; y++) {
      long long z = max(2 * (X - x), 2 * (Y - y));
      long long tmp = a * x + b * y + c * z;
      ans = min(ans, tmp);
    }
  }
  cout << ans << endl;
}
