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

c=0

for i in range(n):

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

  if x ** 2 + y ** 2<= d ** 2:

    c += 1

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

c=0

for i in range(n):

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

  if x * x + y * y <= d * d:

    c += 1

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

n, d = list(map(int, input().split()))
c = 0
for i in range(n):
    x, y = list(map(int, input().split()))
    if x * x + y * y <= d * d:
        c += 1
print(c)

-    if x**2 + y**2 <= d**2: +    if x * x + y * y <= d * d: