#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
    LL int a,b,c,x,y;
    LL int n,ans = mod;
    LL int i;

    cin >> a >> b >> c >> x >> y;

    /*if (a > c && b > c)cout << c*2*max(x,y);
    else if((a+b)/2 > c && x > y)cout << y*2*c + (x-y)*a;
    else if((a+b)/2 > c && x < y)cout << x*2*c + (y-x)*b;
    else if((a+b)/2 > c && x == y)cout << c*2*x;
    else cout << a*x + b*y;*/

    for(i = 0, i <= 10000, i++){
        n = 2*i*c + max(x-i,zero)*a + max(y-i,zero)*b;
        if(n < ans)ans = n;
    }

    cout << ans;

    return 0;
}
