fun main() { val (a, b, c, d, e) = readLine()!!.split(" ").map { it.toInt() } println(maxOf(a - b, a - b + c * (d - e))) }