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

x, y = list(zip(*[list(map(int, input().split())) for i in range(n)]))



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()))

x, y = list(zip(*[list(map(int, input().split())) for i in range(n)]))

 

ans = 0

for i in range(n):

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

        ans += 1

 

print(ans)
n, d = list(map(int, input().split()))
x, y = list(zip(*[list(map(int, input().split())) for i in range(n)]))
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()))
x, y = list(zip(*[list(map(int, input().split())) for i in range(n)]))
ans = 0
for i in range(n):
    if x[i] ** 2 + y[i] ** 2 <= d**2:
        ans += 1
print(ans)

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