N, D = list(map(int, input().split()))

count = 0

for i in range(N):

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

    if (a**2 + b**2) <= D**2:

        count += 1

print(count)

N, D = list(map(int, input().split()))

count = 0

for i in range(N):

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

    if (a*a + b*b) <= D*D:

        count += 1

print(count)

N, D = list(map(int, input().split()))
count = 0
for i in range(N):
    a, b = list(map(int, input().split()))
    if (a**2 + b**2) <= D**2:
        count += 1
print(count)

N, D = list(map(int, input().split()))
count = 0
for i in range(N):
    a, b = list(map(int, input().split()))
    if (a * a + b * b) <= D * D:
        count += 1
print(count)

-    if (a**2 + b**2) <= D**2: +    if (a * a + b * b) <= D * D: