fun main(args: Array<String>) {
    val (A, B, C, X, Y) = listOfLong()
    var k = 0L
    var ans = Long.MAX_VALUE
    while ( k < A + B) {
        val now = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B
        ans = Math.min(ans, now)
        k += 1
    }
    println(ans)
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun listOfString() = next().split(" ")
fun listOfLong(d: Int = 0) = listOfString().map { it.toLong() + d }
