import Control.Applicative
import Control.Monad
import Data.List

-- |
-- >>> solve 4 4 6
-- 5
-- >>> solve 5 4 3
-- 0
-- >>> solve 1 7 10
-- 0
-- >>> solve 1 3 3
-- 1
solve n a b
    | a >  b    = 0
    | a == b    = 1
    | n == 1    = 0
    | n == 2    = 1
    | otherwise = b2 - a2 + 1
  where
    a2 = sum $ replicate (n - 2) a
    b2 = sum $ replicate (n - 2) b

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