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