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)
        tmp = c*2*i + a*max(x-i,0) + b*max(y-i,0)
        ans = min(ans,tmp)
    end do
    write(*,*) ans
    stop
end program