#include <iostream>
using namespace std;

int main(){
    long long A,B,C,X,Y;
    cin >> A>>B>>C>>X>>Y; //入力
    C += C;
    long long result = min(X,Y) * C; //Cでやすいやつ
    long long nokori,Z,W;
    if (X>Y){
        nokori = X - Y;
        if (X > C){
            result = result + nokori * C;
        } else {
            result = result + nokori * A;
        }
    } else {
        nokori = Y - X;
        if (Y > C) {
            result = result + nokori * C;
        } else {
            result = result + nokori * B;
        }
    }

    Z = A*X + B*Y;
    W = max(X,Y) * C;
    long long P = min(Z,result);
    long long Q = min (Z,W);
    long long R = X*min(A,C) + Y*min(B,C);
    cout << min(P,Q,R) << endl;//全部ABで買える時


}
