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

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

    val answer = when {
        c <= a + b -> c * 2 * Math.max(x, y)
        c * 2 < a + b -> c * 2 * Math.min(x, y) + if (x > y) (x - y) * a else (y - x) * b
        else -> a * x + b * y
    }

    println(answer)
}
