defmodule Main do
  def main do
    [n, d] = IO.gets("")
             |> String.trim()
             |> String.split()
             |> Enum.map(&String.to_integer/1)
 
    IO.read(:all) 
    |> String.split() 
    |> Stream.map(&String.to_integer/1)
    |> Stream.chunk_every(2)
    |> Enum.reduce(0, fn [x, y], acc -> dist(x, y, d) + acc end)
    |> IO.puts()
  end
 
    def calc(x, y, d) do
        dist = :math.sqrt(x*x+y*y)
        if dist <= d, do: 1, else: 0
    end
end