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)) {
        val aCount = (x*2 - i + 1)/2
        val bCount = (y*2-i+1)/2
        ans = Math.min(ans, aCount*a+bCount*b+i*c)
    }
    println(ans)
}
