#include<cstdio>
#include<algorithm>
using namespace std;

int main()
{
    int a,b,ab,na,nb;
    while(~scanf("%d%d%d%d%d",&a,&b,&ab,&na,&nb))
    {
        int m1,m2,m3;
        m1=na*a+nb*b;
        if(na>nb)   m2=ab*(nb)+(na-nb)*a;
        else    m3=ab*(na)+(nb-na)*b;
        printf("%d",min(m1,min(m2,m3)));
    }
    return 0;
}
