fun main(args: Array<String>) {
    val (n, a, b) = readLine()!!.split(" ").map(String::toLong)

    if (b < a) {
        println(0)
        return
    }
    when (n) {
        1L -> {
            if (a != b) {
                println(0)
            } else {
                println(1)
            }
        }
        else -> {
            val c = n - 2
            var min = a * c
            var max = b * c
            println(max - min + 1)
        }
    }
}

