fun main(args: Array<String>) {
    var (a, b, c, x, y) = readLine()!!.split(" ").map(String::toInt)

    // ABの個数を全列挙
    val sum = (0..Math.max(x, y)).fold(Integer.MAX_VALUE) { acc, i ->
        Math.min(i * 2 * c + Math.max(0, x - i) * a + Math.max(0, y - i) * b, acc)
    }.let(::println)
}
