object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val A, B, C, X, Y = sc.nextLong()
  val sum = if (A + B < C * 2) {
    A * X + B * Y
  } else {
    val diff = X min Y
    diff * C * 2 +
      (A min (C * 2)) * (X - diff) +
      (B min (C * 2)) * (Y - diff)
  }
  println(sum)
}
