#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  C *= 2;
  long long ans = 1e18;
  for (long long c = 1; c <= max(X, Y); c++) {
    long long a = max(0LL, X - c);
    long long b = max(0LL, Y - c);
    long long cost = A * a + B * b + C * c;
    ans = min(ans, cost);
  }
  cout << ans << endl;
}
