fun main(args: Array<String>) {
    val (a, b, c, x, y) = readLine()?.split(" ")?.map { it.toInt() } ?: return

    var result = Int.MAX_VALUE

    for (abp in 0..(Math.max(x, y) * 2) step 2) {
        val ap = Math.max(x - (abp / 2), 0)
        val bp = Math.max(y - (abp / 2), 0)
        val amount = a * ap + b * bp + c * abp
        if (amount < result) {
            result = amount
        }
    }
    println(result)
}