import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextLong()
  val a = sc.nextLong()
  val b = sc.nextLong()

  if (a > b) {
    println(0)
    return
  }
  if (n == 1L) {
    if (a != b) {
      println(0)
    } else {
      println(1)
    }
    return
  }

  val min = a + (n-2) * a + b
  val max = a + (n-2) * b + b
  println(max - min + 1L)

}
