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