program test
implicit none
integer :: a,b,c,x,y,p(3)

read(*,*) a,b,c,x,y

p(1) = b * max(y-x,0) + c * 2 * x
p(2) = a * max(x-y,0) + c * 2 * y
p(3) = a * x + b * y

write(*,*) minval(p(1:3))
 
end program