#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, AB, Am, Bm, ABm;
  vector<long long> ans(3);
  cin >> Am >> Bm >> ABm >> A >> B;
  ans[1] = Am * A + Bm * B;
  ans[2] = max(A, B) * ABm * 2;
  if (Am + Bm < ABm * 2) {
    ans[0] = Am * A + Bm * B;
  } else {
    ans[0] = min(A, B) * 2 * ABm;
    A -= min(A, B);
    B -= min(A, B);
    if (Am < ABm * 2 && A > 0) {
      ans[0] += A * Am;
    } else if (Bm < ABm * 2 && B > 0) {
      ans[0] += B * Bm;
    } else if (Am > ABm * 2 && A > 0) {
      ans[0] += ABm * 2 * A;
    } else if (Bm > ABm * 2 && B > 0) {
      ans[0] += ABm * 2 * B;
    }
  }
  cout << *min_element(ans.begin(), ans.end()) << endl;
}
