#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define PI 3.14159265358979323846264338327950288419716939937510
#define INF 1000000000
#define lint long long int 

int a,b,c,x,y;
lint price, min=INF;

int main(void){
	scanf("%d %d %d %d %d", &a,&b,&c,&x,&y );

	for(int i=0;i<=x;i++){
		if( x - i < y){
			price = i * a + (x - i) * 2 * c + (b - x + i) * b;
			if(price < min)	min = price;
		}else{
			price = i * a + (x - i) * 2 * c;
			if(price < min)	min = price;
		}
	}
	
	printf("%lld", min)			
	return 0;
}