
fun main(args:Array<String>) {
    val inpt = readLine()!!.split(" ").map { it.toInt() }
    val prc = Proc(inpt[0], inpt[1], inpt[2], inpt[3], inpt[4])
    println(prc.proc())
}


class Proc(val a:Int, val b:Int, val c:Int, val x:Int, val y:Int) {
    fun proc():Int {
        val maxAB = Math.max(x,y) * 2
        var ans = getCost(0)
        for(i in (0..maxAB).filter { it%2==0 }) {
            ans = Math.min(ans, getCost(i))
        }
        return ans
    }

    fun getCost(mixCount:Int):Int {
        var ret = mixCount*c
        ret += Math.max(x - (mixCount/2), 0)*a
        ret += Math.max(y - (mixCount/2), 0)*b
        return ret
    }

}
