#import <stdio.h>
#define MAX(a,b) ((a)>(b)?(a):(b))
void swap(int *x, int *y){
    int tmp = *x;
    *x=*y;
    *y=tmp;
}

int main(){
    int A,B,C,X,Y;
    scanf("%d %d %d %d %d",&A,&B,&C,&X,&Y);
    if(A>B){
        swap(&A,&B);
        swap(&X,&Y);
    }
    int p,q,r;
    if(2*C<A){
        p=0;
        q=0;
        r=2*MAX(X,Y);
    } else if (A+B<2*C){
        p=X;
        q=Y;
        r=0;
    } else if (2*C<B){
        q=0;
        r=2*Y;
        if(X<=Y) {
            p=0;
        } else {
            p=X-Y;
        }
    } else {
        if(X<=Y){
            r=2*X;
            q=Y-X;
            p=0;
        } else {
            r=2*Y;
            p=X-Y;
            q=0;
        }
    }
    printf("%d", p*A+q*B+r*C);
}
