#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for(int i=0;i<(int)n;i++)
#define PI acos(-1)
#define fast_io ios_base::sync_with_stdio(false) ; cin.tie(0); cout.tie(0);
ll mod=1e9+7;

int main(){
    fast_io

    int a, b, ab;
    cin>>a>>b>>ab;
    int x, y;
    cin>>x>>y;
    ll ans=0;

    if(a+b>2*ab){
        int M=max(x, y);
        ans=2*ab*min(x, y);
        int m=min(x, y);
        x-=m;
        y-=m;
        if(a*x+b*y>2*ab){
            ans+=2*ab*(x+y);
        }else{
            ans+=a*x+b*y;
        }
        ans=min(ans, 2*ab*M);
    }else{
        ans=a*x+b*y;
    }
    cout<<ans<<endl;
    return 0;

}
