fun main(args: Array<String>) = p5()

fun p5() {
    val (a, b, c, x, y) = readLine()!!.split(' ').map { it.toLong() }

    var needA = x
    var needB = y
    var answer = 0L

    if (c * 2 <= a) {
        answer += c * 2 * needA
        needB = Math.max(needB - needA, 0)
        needA = 0
    }

    if (c * 2 <= b) {
        answer += c * 2 * needB
        needA = Math.max(needA - needB, 0)
        needB = 0
    }

    if (c * 2 <= a + b) {
        val ab = Math.min(needA, needB)
        answer += c * 2 * ab
        needA = Math.max(needA - ab, 0)
        needB = Math.max(needB - ab, 0)
    }

    answer += needA * a + needB * b

    println(answer)
}
