import Control.Applicative
import Control.Monad
import Data.Bool (bool)

main :: IO ()
main = do
  [n, d] <- f
  solve d <$> replicateM n f >>= print
  where
    f = map read <$> words <$> getLine

solve :: Int -> [[Int]] -> Int
solve d = foldl f 0
  where
    f ct [x, y] = bool ct (ct + 1) $ d * d >= x * x + y * y
