program main
   implicit none
   integer A, B, C, X, Y, countN
   read(*, *) A, B, C, X, Y
   countN = 0
   if(X == Y) then
       if(A+B > 2 * C) then
	       countN = 2 * X * C
	   else
	       countN = (A + B) * X
	   end if
   else if (X > Y) then
       if(A+B > 2 * C) then
	       countN = 2 * Y * C
	   else
	       countN = (A + B) * Y
	   end if
	   X = X - Y
	   if(A > 2 * C) then
	       countN = countN + 2 * X * C
	   else
	       countN = countN + X * A
	   end if
   else
       if(A+B > 2 * C) then
	       countN = 2 * X * C
	   else
	       countN = (A + B) * X
	   end if
	   Y = Y - X
	   if(B > 2 * C) then
	       countN = countN + 2 * Y * C
	   else
	       countN = countN + Y * B
	   end if
   end if
   write(*, *) countN   
end program main