
fun main(args:Array<String>):Unit {
    val (a, b, c, x, y) = readLine()!!.split(' ').map(String::toInt)
    var aNum = 0
    var bNum = 0
    var cNum = 0
    if (a + b > c * 2){
        cNum += min(x, y) * 2
        if (a >= c * 2 && cNum < x * 2){
            cNum += (x - cNum / 2) * 2
        }
        if (b >= c * 2 && cNum < y * 2){
            cNum += (y - cNum / 2) * 2
        }
        aNum = if (x - cNum / 2 > 0) x - cNum / 2 else 0
        bNum = if (y - cNum / 2 > 0) y - cNum / 2 else 0
    }else{
        aNum = x
        bNum = y
    }
    println(a * aNum + b * bNum + c * cNum)
}
fun min(a:Int, b:Int):Int = if (a < b) a else b