#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int dp[100000][100000];
  dp[0][0] = 0;
  dp[1][0] = A;
  dp[0][1] = B;
  dp[1][1] = min(A + B, 2 * C);
  for (int x = 1; x < X; x++) {
    for (int y = 1; y < Y; y++) {
      dp[x][y] = dp[x - 1][y] + A;
      dp[x][y] = min(dp[x][y], dp[x][y - 1] + B);
      dp[x][y] = min(dp[x][y], dp[x - 1][y - 1] + 2 * C);
    }
  }
  cout << dp[X][Y];
}
