import java.math.*

fun main(args: Array<String>) {
    val (A, B, C, X, Y) = readInputLine().split(" ").map{it.toLong()}
    
    var ABpizza = Math.max(X, Y) * 2L
    
    var ans = Long.MAX_VALUE

    while (ABpizza >= 0) {
        val tmp = Math.max(X - ABpizza / 2L, 0L) * A + Math.max(Y - ABpizza / 2L, 0L) * B + ABpizza * C
        ans = Math.min(tmp, ans)
        
        ABpizza -= 2L
    }
    
    println(ans)
}

fun readInputLine(): String {
    return readLine()!!
}
