main = do
    ns <- getLine >>= return . map read . words
    let n = ns !! 0
    let d = ns !! 1
    xys <- mapM getPoints [1..n]
    let count = length $ filter (\x -> x <= d * d) $ map (\(x,y) -> x*x + y*y) xys
    print count

getPoints _ = do
    ns <- getLine >>= return . map read . words
    let x = ns !! 0
    let y = ns !! 1
    return (x,y)