fun main(arr:Array<String>) {
    val (a,b,c,x,y) = readLine()!!.split(" ").map { it.toInt() }
    val cMax = Math.max(x,y)*2
    var ans = cMax * c
    for(i in (0..cMax step 2)) {
        val aCount = Math.max(x - (i/2), 0)
        val bCount = Math.max(y - (i/2),0)
        ans = Math.min(ans, aCount*a+bCount*b+i*c)
    }
    println(ans)
}
