object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val a, b, c, x, y = sc.nextInt()
  val sum = x + y
  val p = new Array[Int](sum+1)
  for (i <- 0 to sum) {
    val ab2 = c * 2 * i
    val x1 = if (x - i > 0) (x - i) * a else 0
    val y1 = if (y - i > 0) (y - i) * b else 0
    p(i) = ab2 + x1 + y1
  }
  println(p.min)
}