import scala.io.{StdIn => in}
import annotation.tailrec

object ABC095C extends App {

  val Array(a, b, c, x , y) = in.readLine.split(" ").map(_.toInt).toArray

  val ans = (a, b, c) match {
    case (a, b, c) if (c * 2 <= a) && (c * 2 <= b) => math.max(x, y) * c * 2
    case (a, b, c) if a + b <= c * 2 => a * x + b * y
    case _ => {
      val m = math.max(x, y)
      val s = math.min(x, y)
      val cost = if(x > y) a else b
      s * c * 2 + (m - s) * cost
    }
  }

  println(ans)
}