import java.util.Scanner

object Main extends App {

  val sc = new Scanner(System.in)

  val n = sc.nextLong
  val a = sc.nextLong
  val b = sc.nextLong

  val res =
    if(a > b) 0L
    else {
      n match {
        case 1 if a != b => 0L
        case x if x <= 2L => 1L
        case _ => (n - 2L) * b - (n - 2L) * a + 1L
      }
    }

  println(res)
}