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