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

fun abc095c() {
    val (aPrice, bPrice, mixPrice, aNeeded, bNeeded) = readLine()!!.split(" ").map { it.toInt() }

    val noMix = aPrice * aNeeded + bPrice * bNeeded

    val neededDiff = Math.abs(aNeeded - bNeeded)
    val withMix = (if (aNeeded == bNeeded) 0 else if (aNeeded > bNeeded) aPrice * neededDiff else bPrice * neededDiff) +
            Math.min(aNeeded, bNeeded) * 2 * mixPrice

    val onlyMix = Math.max(aNeeded, bNeeded) * 2 * mixPrice

    println(Math.min(Math.min(noMix, withMix), onlyMix))
}
