#include <bits/stdc++.h>
using namespace std;
inline void solve() {
  const int MAX_N = 210001;
  int A, B, C, X, Y, i, j;
  int dp[MAX_N][MAX_N];
  std::cin >> (A) >> (B) >> (C);
  std::cin >> (X) >> (Y);
  for ((i) = (0); (i) < (MAX_N); (i)++)
    for ((j) = (0); (j) < (MAX_N); (j)++) dp[i][j] = INT_MAX;
  dp[0][0] = 0;
  dp[1][0] = min(A, C);
  dp[0][1] = min(B, C);
  dp[1][1] = min(A + B, C);
  X *= 2;
  Y *= 2;
  for ((i) = (0); (i) <= (X); (i)++) {
    for ((j) = (0); (j) <= (Y); (j)++) {
      dp[i + 2][j] = min(dp[i + 2][j], dp[i][j] + A);
      dp[i][j + 2] = min(dp[i][j + 2], dp[i][j] + B);
      dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i][j] + C);
    }
  }
  std::cout << dp[X][Y] << std::endl;
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return EXIT_SUCCESS;
}
