fun main(args: Array<String>) {
    val (a, b, c, x, y) = readLongList()
    var ans = Long.MAX_VALUE
    for (i in 0..(2 * Math.max(x, y))) {
        val aCount = Math.max(x - i / 2, 0)
        val bCount = Math.max(y - i / 2, 0)
        ans = Math.min(a * aCount + b * bCount + c * i, ans)
    }

    ans.let(::println)
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
