object Main extends App {
  import scala.math.max
  
  val Array(a,b,c,x,y) = readLine.split(" ").map{_.toInt}
  val z = max(x,y)
  
  println((for (i <- 0 to 2*z by 2; j = max(0,x-i/2); k = max(0,y-i/2)) yield i*c + j*a + k*b).min)
}