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