
fun main(arr:Array<String>) {

    val (a,b,c,x,y) = readLine()!!.split(" ").map { it.toInt() }
    val ans = (0..Math.max(x,y)*2).filter { it%2 == 0 }.map { it*c + Math.max(0, x-it/2)*a + Math.max(0,y-it/2)*b }.min()
    println(ans)
}
