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

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

    var answer = Int.MAX_VALUE.toLong()

    for (abPizza in 0..2000000) {
        answer = Math.min(answer, c * abPizza + a * Math.max(x - abPizza / 2, 0) + b * Math.max(y - abPizza / 2, 0))
    }

    println(answer)
}
