#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int m = 1e9;
  for (int i = 0; i <= x; ++i) {
    for (int j = 0; j <= y; ++j) {
      for (int k = 0; k <= 2 * x && k <= 2 * y; k += 2) {
        if (i + k / 2 == x && j + k / 2 == y) {
          int sum = a * i + b * j + c * k;
          m = min(m, sum);
          break;
        }
      }
    }
  }
  cout << m << endl;
  return 0;
}
