function Main(input){
	input=input.split(/\s/);
	input.forEach(function(e,i,a){a[i]=Number(a[i]);});
	var a=input[3]-input[4];
	a=(a^(a>>31))-(a>>31);
	var b=input[3]<input[4]?0:1;//
	var c=(input[0]+input[1])*input[b+3];
	c=c<(input[2]*(input[b+3]<<1))?c:(input[2]*(input[b+3]<<1));
	b^=1;
	if(input[b]<(input[2]<<1)){c+=input[b]*a;}
	else{c+=(input[2]<<1)*a;}
	console.log(c);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));