program Half_and_Half
    implicit none
    integer(4):: a,b,c
    integer(4):: x,y
    
    read*, a,b,c,x,y

    print*, min(x,y) * min(a+b, 2*c) + min(max((x-y)*a,(y-x)*b), abs(x-y)*2*c)

end program Half_and_Half