#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx")
using namespace std;
template <typename T>
void print_array(T arr[], size_t n) {
  for (int i = 0; i < n; i++) printf("%d%c", arr[i], (i == n - 1) ? '\n' : ' ');
}
int A, B, C;
int f(int x, int y) {
  vector<int> candidates;
  if (x > 0) {
    candidates.push_back(f(x - 2, y) + A);
  }
  if (y > 0) {
    candidates.push_back(f(x, y - 2) + B);
  }
  if (x > 0 || y > 0) {
    candidates.push_back(f(x - 1, y - 1) + C);
  }
  if (x <= 0 && y <= 0) {
    candidates.push_back(0);
  }
  return *min_element(candidates.begin(), candidates.end());
}
int main() {
  int X, Y;
  cin >> A >> B >> C >> X >> Y;
  cout << f(2 * X, 2 * Y) << '\n';
}
