fun main(args: Array<String>) {
    var (a, b, c, x, y) = readLine()!!.split(" ").map(String::toInt)

    var sum = 0
    if ((a + b) / 2 > c) {
        var min = Math.min(x, y)
        x -= min
        y -= min
        sum = min * c * 2
    }

    sum += if(a > c * 2){
        x * c * 2
    }else{
        x * a
    }

    sum += if(b > c * 2){
        y * c * 2
    }else{
        y * b
    }

    println(sum)

}
