fun c95(args: Array<String>) {
    val (a, b, c, x, y) = args[0].split(" ").map { it.toInt() }
    val ansList = (0..Math.min(x, y)).map { cNum ->
        a * (x - cNum / 2) + b * (y - cNum / 2) + c * cNum
    }
    println(ansList.min())
}

fun main(args: Array<String>) {
    c95(readLineList())
}

fun readLineList(): Array<String> {
    val lineList = mutableListOf<String>()
    while (true) {
        val line = readLine()
        if (line.isNullOrBlank()) {
            break
        } else {
            lineList.add(line!!)
        }
    }
    return lineList.toTypedArray()
}