program distance
  implicit none
  integer :: n, i, m = 0
  integer(8) :: d, x, y
  read(*,*) n, d
  d = d * d
  do i = 1, n
    read(*,*) x, y
    if (x * x + y * y <= d) m = m + 1
  end do
  write(*,'(i0)') m
end program distance