import Control.Monad
solve :: Int -> [Int] -> Int
solve c [a,b] = if (((a * a) + (b * b)) <= (c * c)) then 1 else 0

main = do
 [n,d] <- map read . words <$> getLine :: IO [Int]
 ans <- replicateM n $ (solve d) . (map read . words) <$> getLine
 print $ sum ans