object Main extends App {

  val Array(a,b,c,x,y) = scala.io.StdIn.readLine().split(" ").map(_.toInt)

  def solve(): Long = {
    val AandB = a * x + b * y
    val z = Math.max(x, y) * 2
    val AB = c * z
    val defaultMin = Math.min(AandB, AB)
    (z-2 to 2 by -2).foldLeft(defaultMin) { case (acc, i) =>
      val priceAB = c * i
      val priceA = Math.max(0, x - i / 2) * a
      val priceB = Math.max(0, y - i / 2) * b
      Math.min(acc, priceA + priceB + priceAB)
    }
  }
  println(solve)

}