import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)

readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

isLegal n a b =
  if n == 1
  then a == b
  else a <= b

main = do
  [n, a, b] <- readInts
  if isLegal n a b 
    then print $ (n - 2) * (b - a) + 1
    else print 0
