module Main where

import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.String
import Data.List
import Data.Maybe
import Control.Monad

main :: IO ()
main = do
  [n, d] <- map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine
  xn <- replicateM n (map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine)
  print . length . filter (==True) $ map (solve d) xn

solve :: Int -> [Int] -> Bool
solve d [p, q] =
  dist <= d
  where
    dist = ceiling . sqrt . fromIntegral $ (p ^ 2) + (q ^ 2)
