main = do
  li <- getLine
  let [n,a,b] = map read $ words li
  let ans = compute n a b
  print ans

compute :: Int -> Int -> Int -> Int
compute 0 _ _ = 0
compute 1 a b = if a == b then 1 else 0
compute n a b
  | a > b = 0
  | True  = ub - lb + 1
  where
    n1 = pred n
    lb = a * n1 + b
    ub = a + n1 * b
