fun readInts() = readLine()!!.split(' ').map(String::toInt)

fun main(args: Array<String>) {
    val (a, b, c, x, y) = readInts()
    val z = Math.min(x, y)
    var amt = if (0 < x - z) {
        Math.min(a, c + c) * (x - z)
    } else {
        Math.min(b, c + c) * (y - z)
    }
    amt += z * Math.min(a + b, c + c)
    println(amt)
}
