#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int ans = 100000000;
  for (int i = 0; i <= max(x, y); i++) {
    int d = max(x - i, 0) * a + max(y - i, 0) * b + i * 2 * c;
    ans = min(ans, d);
  }
  cout << ans;
}
