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

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