Scanf.scanf "%d %d" (fun n d ->
    let xy = Array.init n (fun _ -> Scanf.scanf " %d %d" (fun x y -> if x * x + y * y <= d * d then 1 else 0)) in
    Array.fold_left (+) 0 xy |> Printf.printf "%d\n"
)