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) + abs(x-y)*min(extra(),2*c)

contains
    function extra() result(ret)
        integer(4):: ret

        if (x==y) then
            ret=0
        else if (x > y) then
            ret=a
        else
            ret=b
        end if
    end function
end program Half_and_Half