#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
ll mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int a, b, ab;
  cin >> a >> b >> ab;
  int x, y;
  cin >> x >> y;
  ll ans = 0;
  if (a + b > 2 * ab) {
    ans = 2 * ab * min(x, y);
    int m = min(x, y);
    x -= m;
    y -= m;
    if (a * x + b * y > 2 * ab) {
      ans += 2 * ab * (x + y);
    } else {
      ans += a * x + b * y;
    }
  } else {
    ans = a * x + b * y;
  }
  cout << ans << endl;
  return 0;
}
