let id x = x
let (n,a,b) = Scanf.scanf "%d %d %d\n" (fun n a b -> (n,a,b))
 
let ans = if b-a < 0 || (b-a > 0 && n=1) then 0
    else if a=b then 1
    else (b-a) * (n-2) +1

let () =
  Printf.printf "%d\n" ans