#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int a, b, ab, na, nb;
  cin >> a >> b >> ab >> na >> nb;
  long long int ans = 0;
  if ((2 * ab) < (a + b)) {
    if (na > nb) {
      ans += (nb * 2) * ab;
      long long int old = nb;
      nb %= 2;
      na -= old - nb;
    } else {
      ans += (na * 2) * ab;
      long long int old = na;
      na %= 2;
      nb -= old - na;
    }
  }
  long long int old = ans;
  ans += na * a;
  ans += nb * b;
  cout << min(ans, old + max(na, nb) * 2 * ab);
}
