using namespace std;
#include <vector>
#include <numeric>
#include <map>
#include <cmath>
#include <iomanip>
#include <queue>
using ll =long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vs = vector<string>;

int main() {
    ll A, B, C, X, Y;
     cin >> A >> B >> C >> X >> Y;

     ll sum = 0;
     ll a=0, b=0, c=0;
     ll hikaku = A+B;

     while(1){
         if(C*2 <= hikaku){
             sum += C*2;
             a++;
             b++;
         }
         else{
             if(hikaku == A){
                 sum += A;
                 a++;
             }
             else if(hikaku == B){
                 sum += B;
                 b++;
             }
             else{
                 sum += A+B;
                 a++;
                 b++;
             }
         }
         if(a >= X and b >= Y){
             break;
         }
         else if(a >= X){
             hikaku = B;
         }
         else if(b >= Y){
             hikaku = A;
         }
     }
     cout << sum << endl;

}