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



ans = 0

for i in range(N):

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

    dist = pow((x * x + y * y), 0.5)

    # print(dist)

    if dist <= D:

        ans += 1



print(ans)

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



ans = 0

for i in range(N):

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

    # dist = pow((x * x + y * y), 0.5)

    dist = (x * x + y * y)

    

    # print(dist)

    if dist <= D*D:

        ans += 1



print(ans)

N, D = list(map(int, input().split()))
ans = 0
for i in range(N):
    x, y = list(map(int, input().split()))
    dist = pow((x * x + y * y), 0.5)
    # print(dist)
    if dist <= D:
        ans += 1
print(ans)

N, D = list(map(int, input().split()))
ans = 0
for i in range(N):
    x, y = list(map(int, input().split()))
    # dist = pow((x * x + y * y), 0.5)
    dist = x * x + y * y
    # print(dist)
    if dist <= D * D:
        ans += 1
print(ans)

-    dist = pow((x * x + y * y), 0.5) +    # dist = pow((x * x + y * y), 0.5) +    dist = x * x + y * y -    if dist <= D: +    if dist <= D * D: