let f () = Scanf.scanf "%d %d\n" (fun a b -> a, b)

let () =
  let n, d = f () in
  let d2 = d * d in
  let rec g i s =
    if i = n then
      print_int s
    else
      let x, y = f () in
      if x * x + y * y <= d2 then
        g (i + 1) (s + 1)
      else
        g (i + 1) s
  in g 0 0
