fun main(args: Array<String>) {
    val (a, b, c, x, y) = readLongList()
    var ans = Long.MAX_VALUE
    for (i in 0L..x) {
        for (j in 0L..y) {
            val k = 2L * Math.max(Math.max(x - i, 0L), Math.max(y - j, 0L))
            ans = Math.min(a * i + b * j + c * k, 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)
