#include <bits/stdc++.h>
using namespace std;
int minVec(vector<int> &vv) {
  int min = 40000000;
  for (int v : vv) {
    if (v < min) {
      min = v;
    }
  }
  return min;
}
int main() {
  int A, B, C, x, y;
  cin >> A >> B >> C >> x >> y;
  int maxNum = max(x, y);
  int minNum = min(x, y);
  vector<int> ansVec;
  for (int c = 0; c <= maxNum * 2; c += 2) {
    for (int a = 0; a <= x; a++) {
      for (int b = 0; b <= y; b++) {
        if (maxNum == max(a + (c / 2), b + (c / 2)) &&
            (min(a + (c / 2), b + (c / 2)) >= minNum)) {
          ansVec.push_back(A * a + B * b + C * c);
        } else {
          continue;
        }
      }
    }
  }
  cout << minVec(ansVec) << endl;
  return 0;
}
