fun main(args: Array<String>) {
    val (A, B, C, X, Y) = listOfLong()
    val p1 = A * X + B * Y
    val p2 = when {
        (X > Y) -> Y * 2 * C + (X - Y) * A
        (X < Y) -> X * 2 * C + (Y - X) * B
        else -> (X + Y) * C
    }
    val p3 = Math.max(X, Y) * 2 * C
    val ans = listOf(p1, p2, p3).min()!!
    println(ans)
}

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