import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    [n,a,b] <- getIntList
    let ans | a > b || (n == 1 && a /= b) = 0 
            | otherwise = (b*(n-1) + a) - (b + a*(n-1)) + 1
    print ans