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