open Printf
open Scanf

let solve n a b =
  if a > b then 0
  else
    if n = 1 then
      if a = b then 1 else 0
    else
      (n-2) * b - (n-2) * a + 1

let () =
  scanf "%d %d %d\n" (fun x y z -> solve x y z) |> printf "%d\n"
