solve n a b
  | a > b = 0
  | (n == 1) && (a == b) = 1
  | (n == 1) && (a /= b) = 0
  | otherwise = (n-2) * (b-a) + 1

main = do
  [n,a,b] <- map read . words <$> getLine :: IO [Int]
  print $ solve n a b 
