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

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