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


solv :: Int -> Int -> Int
solv n k = length $ allPairs n k

allPairs :: Int -> Int -> [(Int, Int)]
allPairs n k = do
    b <- [1..n]
    c <- [0..b-k-1]
    q <- [0..(n-k-c) `div` b]
    let a = b*q + k + c
    if a >= 1 && a <= n then return (a,b) else []
