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

    x_y = for _ <- 1..n, do: IO.gets("") |> String.trim()

    x_y
    |> Stream.map(&String.split/1)
    |> Stream.flat_map(fn [x, y] -> [x, y] end)
    |> Stream.map(&String.to_integer/1)
    |> Stream.chunk_every(2)
    |> Enum.map(&to_distance/1)
    |> count(d, 0)
    |> IO.puts
  end

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

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