
defmodule Main do
  def main do
    [n, d] = IO.gets("")
             |> String.trim()
             |> String.split()
             |> Enum.map(&String.to_integer/1)

    x_y    = 1..n
             |> Stream.map(fn _ -> IO.gets("") |> String.trim() end)
             |> Stream.map(&String.split/1)
             |> List.flatten()
             |> Stream.map(&String.to_integer/1)
             |> Stream.chunk_every(2)

    x_y
    |> Enum.filter(&ok?(&1, d))
    |> length()
    |> IO.puts()
  end

  def ok?([x, y], d) do
    dist = :math.sqrt(x*x+y*y)
    if dist <= d do
      true
    else
      false
    end
  end
end
