makeSum :: Int ->  (Int, Int) -> Int 
makeSum n (p, q)
  | n < 1     = 0
  | n == 1    = if q - p == 0 then 1 else 0
  | otherwise = if (q - p) >= 0 then (n - 2) * (q - p) + 1 else 0

main = do
  [n, minVal, maxVal] <- map read . words <$> getLine
  putStrLn $ show $ makeSum n (minVal, maxVal)
  
