#include<bits/stdc++.h>
using namespace std;

int main(){
        int A,B,C,X,Y;
        cin >> A>>B>>C>>X>>Y;
        int ans;
        if((A+B) < (C*2))
        {
                ans = A*X + B*Y;
        }
        else if((A+B) > (C*2))
        {
                int p,q;
                cbuy1 = min(x, y);
                p = C*2*Y;
                p+=A * (X - cbuy1) + b * (y - cbuy1);

                cbuy2 = max(x, y);
                q= C*2*Y;
                q += c * cbuy2 * 2;
                ans = min(p,q);
        }

        cout << ans << endl;

}
