main = fmap (map read . words) getLine >>= \[n,a,b] -> print (solve n a b)

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