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