import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    //nextLineとnextを同時に使ったら死ぬ
    val sc = new Scanner(System.in)
    val a, b, c, x, y = sc.nextInt()
    val max = math.max(x, y)

    var ans = Long.MaxValue
    for (i <- 0 to max * 2) {
      val aa = math.max(0, x - i)
      val bb = math.max(0, y - i)
      ans = math.min(ans, c * i * 2 + aa * a + bb * b)
    }

    println(ans)
  }

}
