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

point = []

for i in range(N):

    point.append(list(map(int, input().split())))



ct = 0

D2 = D * D

for i in point:

    if (i[0]**2 + i[1]**2) <= D2:

        ct += 1



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



ct = 0

D2 = D * D

for i in range(N):

    X, Y = list(map(int, input().split()))

    if (X**2 + Y**2) <= D2:

        ct += 1



print(ct)
N, D = list(map(int, input().split()))
point = []
for i in range(N):
    point.append(list(map(int, input().split())))
ct = 0
D2 = D * D
for i in point:
    if (i[0] ** 2 + i[1] ** 2) <= D2:
        ct += 1
print(ct)

N, D = list(map(int, input().split()))
ct = 0
D2 = D * D
for i in range(N):
    X, Y = list(map(int, input().split()))
    if (X**2 + Y**2) <= D2:
        ct += 1
print(ct)

-point = [] -for i in range(N): -    point.append(list(map(int, input().split()))) -for i in point: -    if (i[0] ** 2 + i[1] ** 2) <= D2: +for i in range(N): +    X, Y = list(map(int, input().split())) +    if (X**2 + Y**2) <= D2: