object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datA, datB, datC, datX, datY) = readLine.split(" ").map(_.toInt)
    // compare the cost for making each pizzas
    import math.min
    val cost2x2 = min((datA + datB), (datC * 2))
    val costA = min(datA, (datC * 2))
    val costB = min(datB, (datC * 2))
    val ans =
      if(datX > datY) datY * cost2x2 + (datX - datY) * costA
      else datX * cost2x2 + (datY - datX) * costB
    println(ans)
  }
}
