program probc
    implicit none
    integer::a, b, c, x, y, i, tmp, ans
    read(*,*) a, b, c, x, y

    ans = a*x + b*y
    tmp = ans
    do i = 0, max(x,y)
        if(i <= min(x,y)) then
            tmp = c*2*i + a*(x-i) + b*(y-i)
        else
            if(x >= y) then
                tmp = c*2*i + a*(x-i)
            else
                tmp = c*2*i + b*(y-i)
            end if
        end if
        ans = min(ans,tmp)
    end do
    write(*,*) ans
    stop
end program