import math.max
object Main extends App {
    val Array(a,b,c,x,y) = io.StdIn.readLine.split(" ").map(_.toInt)

    val c_up_limit = max(2*x, 2*y)
    
    val prices = for {
        countC <- 0 to c_up_limit by 2

        val countA = max(0, x-countC/2)
        val countB = max(0, y-countC/2)

    } yield countA*a + countB*b + countC*c

    val result = prices.min
    println(result)
}