


program main
    implicit none
    integer*8::a,b,c,x,y,ans=1000000000,i
    read(*,*)a,b,c,x,y
    do i=0,max(x,y)
        ans=min(ans,c*2*i+a*max(0,x-i)+b*max(0,y-i))
    end do
    print*,ans
end program
