#include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/tag_and_trait.hpp>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0)
#define END return EXIT_SUCCESS
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR(I,0,N)
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) std::cin>>(P)
#define IN2(P1,P2) std::cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) std::cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP(I,N) std::cin>>V[I]
#define OUT(P) std::cout<<P<<std::endl
#define OUT2(P1,P2) std::cout<<P1<<" "<<P2<<std::endl
#define OUT3(P1,P2,P3) std::cout<<P1<<" "<<P2<<" "<<P3<<std::endl
#define OUTS(I,N,V) REP(I,N) std::cout<<V[i]<<std::endl
#define ALL(C) (C).begin(),(C).end()
using namespace std;
// using namespace __gnu_pbds;
const int MAX_N=210001;
int A,B,C,X,Y,i,j;
int dp[MAX_N][MAX_N];
inline void solve(){
  IN3(A,B,C);
  IN2(X,Y);
  REP(i,MAX_N)REP(j,MAX_N)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;
  UP(i,0,X){
    UP(j,0,Y){
      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);
    }
  }
  OUT(dp[X][Y]);
}

int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}
