#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a(5);
  for (int i = 0; i < (int)(5); i++) cin >> a.at(i);
  int mil;
  int l = min(a.at(3), a.at(4));
  for (int i = 0; i <= l; i++) {
    int k = a.at(3) - i;
    int j = a.at(4) - i;
    int tmp = a.at(0) * k + a.at(1) * j + a.at(2) * i * 2;
    if ((tmp < mil) || (i == 0)) mil = tmp;
  }
  cout << mil << endl;
  return 0;
}
