#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 = a * x + b * y;
  for (int i = 0; i <= x; i++) {
    for (int j = 0; j <= y; j++) {
      long long tmp = a * i + b * j + 2 * c * (max(x - i, y - j));
      ans = min(tmp, ans);
    }
    cout << i;
  }
  cout << ans << endl;
}
