n,d = list(map(int, input().split()))



dotCount = 0

square_d = d*d

for i in range(n):

  #print(i)

  x,y = list(map(int, input().split()))

  if square_d >= x**2 + y**2:

    dotCount += 1

    

print(dotCount)

coordinate_number,distance = list(map(int, input().split()))



within_distance = 0

square_distance = distance*distance

for i in range(coordinate_number):

  x,y = list(map(int, input().split()))

  if square_distance >= x*x + y*y:

    within_distance += 1



print(within_distance)

n, d = list(map(int, input().split()))
dotCount = 0
square_d = d * d
for i in range(n):
    # print(i)
    x, y = list(map(int, input().split()))
    if square_d >= x**2 + y**2:
        dotCount += 1
print(dotCount)

coordinate_number, distance = list(map(int, input().split()))
within_distance = 0
square_distance = distance * distance
for i in range(coordinate_number):
    x, y = list(map(int, input().split()))
    if square_distance >= x * x + y * y:
        within_distance += 1
print(within_distance)

-n, d = list(map(int, input().split())) -dotCount = 0 -square_d = d * d -for i in range(n): -    # print(i) +coordinate_number, distance = list(map(int, input().split())) +within_distance = 0 +square_distance = distance * distance +for i in range(coordinate_number): -    if square_d >= x**2 + y**2: -        dotCount += 1 -print(dotCount) +    if square_distance >= x * x + y * y: +        within_distance += 1 +print(within_distance)