import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val a = sc.nextInt()
    val b = sc.nextInt()
    val c = sc.nextInt()
    val x = sc.nextInt()
    val y = sc.nextInt()

    var sum = a * x + b * y

    if (c * 2 >= a + b) {
        println(sum)
        return
    }

    var c_count = Math.min(x, y)

    var x_rest = x - c_count
    var y_rest = y - c_count

    c_count *= 2

    while (x_rest != 0 ||  y_rest != 0) {
        if ((Math.min(x_rest, 1) * a + Math.min(y_rest, 1) * b) > c * 2) {
            x_rest = Math.max(0, x_rest - 1)
            y_rest = Math.max(0, y_rest - 1)
            c_count += 2
        } else {
            break
        }
    }

    println(x_rest * a + y_rest * b + c_count * c )

}
