import scala.io.StdIn._
object Main extends App {
  val Array(a, b, c, x, y) = readLine.split(" ").map(_.toInt)
  println((0 to math.max(x, y)).map { i =>
    math.max(0, x - i) * a + math.max(0, y - i) * b + 2 * c * i
  }.min)
}
