fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(java.util.Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    fun solve(sc: java.util.Scanner, pw: java.io.PrintWriter) {
        val A = sc.next().toInt()
        val B = sc.next().toInt()
        val C = sc.next().toInt()
        val X = sc.next().toInt()
        val Y = sc.next().toInt()

        var a = 0
        var b = 0
        var c = 0
        if (A + B > C * 4) {
            c = Math.max(X, Y) * 2
        } else if (A + B > C * 2) {
            c = Math.min(X, Y) * 2
            a = X - c / 2
            b = Y - c / 2
        } else {
            a = X
            b = Y
        }

        pw.println(A * a + B * b + C * c)
    }
}
