object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val a,b,c,x,y = sc.nextInt()
  val result = (0 to Array(x,y).max).map(_*2).map{nab => {
    val na = if (2*x>=nab){
      x-nab/2
    } else {0}
    val nb = if (2*y>=nab){
      y-nab/2
    } else {0}
    na*a+nb*b+nab*c
  }}.min
  println(result)
}