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

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

    sum += x * Math.min(a, c * 2)
    sum += y * Math.min(b, c * 2)

    println(sum)

}
