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

x = []

y = []

for i  in range(n):

        a = list(map(int, (input().split())))

        x.append(a[0])

        y.append(a[1])



ans = 0

for i in  range(n):

        if (x[i] ** 2 + y[i] ** 2) ** (0.5)  <= d:

                ans += 1



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

ans = 0



for _ in range(n):

        p, q = list(map(int, input().split()))

        if (p ** 2 + q ** 2) ** 0.5  <= d:

                ans += 1

                

print(ans)
n, d = list(map(int, input().split()))
x = []
y = []
for i in range(n):
    a = list(map(int, (input().split())))
    x.append(a[0])
    y.append(a[1])
ans = 0
for i in range(n):
    if (x[i] ** 2 + y[i] ** 2) ** (0.5) <= d:
        ans += 1
print(ans)

n, d = list(map(int, input().split()))
ans = 0
for _ in range(n):
    p, q = list(map(int, input().split()))
    if (p**2 + q**2) ** 0.5 <= d:
        ans += 1
print(ans)

-x = [] -y = [] -for i in range(n): -    a = list(map(int, (input().split()))) -    x.append(a[0]) -    y.append(a[1]) -for i in range(n): -    if (x[i] ** 2 + y[i] ** 2) ** (0.5) <= d: +for _ in range(n): +    p, q = list(map(int, input().split())) +    if (p**2 + q**2) ** 0.5 <= d: