defmodule Main do
  def main do
    [n, d] = IO.gets("")
             |> String.trim()
             |> String.split()
             |> Enum.map(&String.to_integer/1)
    1..n
    |> Stream.map(fn _ -> Task.async(fn -> process(d) end) end)
    |> Enum.reduce(0, fn worker, acc -> acc + Task.await(worker) end)
    |> IO.puts()
  end

  def process(d) do
    input()
    |> eval(d)
  end

  def input do
    IO.gets("")
    |> String.trim()
    |> String.split()
    |> Enum.map(&String.to_integer/1)
    |> distance()
  end

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

  def eval(dist, d) when dist <= d, do: 1
  def eval(_, _), do: 0

end
