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()

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

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