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

    input(n, [])
    |> count(d, n, 0)
    |> IO.puts()
  end

  def input(0, acc), do: acc
  def input(n, acc) do
    xy = IO.gets("")
         |> String.trim()
         |> String.split()
         |> Enum.map(&String.to_integer/1)
         |> distance()

    input(n-1, [xy | acc])
  end

  defp distance([x, y]) do
    :math.sqrt(x*x+y*y)
  end

  def count([], _, 0, acc), do: acc

  def count([xy | tail], d, n, acc) when xy <= d do
    count(tail, d, n-1, acc+1)
  end

  def count([_ | tail], d, n, acc) do
    count(tail, d, n-1, acc)
  end
end
