#include<stdio.h>
int main()
{
int A,B,C,X,Y,z=0,p=0;
while(1)
{
scanf_s("%d %d %d %d %d",&A,&B,&C,&X,&Y);
if(A>=1&&B>=1&&C>=1&&A<=5000&&B<=5000&&C<=5000&&X>=1&&Y>=1&&X<=10^5&&Y<=10^5)
break;
}
if(2*C>(X+Y))
{
z=X*A+Y*B;
printf("%d",z);
}

else if((X+Y)>2*C)
{
if(X>Y)
{
z=(X-Y)*A;
p=2*C*Y;
printf("%d",z+p);
}

if(Y>X)
{
z=(Y-X)*B;
p=2*C*X;
printf("%d",z+p);
}

if(X==Y)
{
p=2*C*X;
printf("%d",z+p);
}
}

else if(2*C==(X+Y))
{
z=(X+Y)*C;
printf("%d",z+p);
}

return 0;
}


