import scala.io.StdIn._
object Main extends App {
  val Array(a, b, c, x, y) = readLine.split(" ").map(_.toInt)
  var cost = Long.MaxValue
  for (i <- 0 to math.max(x, y) * 2 by 2) {
    val tmp = math.max(0, (x - i / 2)) * a + math.max(0, (y - i / 2)) * b + c * i
    cost = math.min(cost, tmp)
  }
  println(cost)
}
