#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main(void){
    int priceA,priceB,priceAB;
    int numA,numB;
    int sum_price[4]={0};
    int min=100000000;

    scanf("%d %d %d %d %d",&priceA,&priceB,&priceAB,&numA,&numB);

    int i;
    sum_price[0]=(priceA*numA)+(priceB*numB);
    if(numA<numB){
        sum_price[1]=(priceAB*2*numA)+(priceB*(numB-numA));
        sum_price[2]=(priceAB*2*numB);
        sum_price[3]=(priceA*numA)+(priceAB*2*(numB);
    }
    else if(numA>=numB){
        sum_price[1]=(priceAB*2*numB)+(priceA*(numA-numB));
        sum_price[2]=(priceAB*2*numA);
        sum_price[3]=(priceB*numB)+(priceAB*2*numA);
    }

    for(i=0;i<4;i++){
        if(min>sum_price[i]){
            min=sum_price[i];
        }
    }

    printf("%d",min);
    return 0;
}
