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

cnt = 0

for _ in range(N):

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

    if x ** 2 + y ** 2 <= D ** 2:

        cnt += 1

        

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

cnt = 0

for _ in range(N):

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

    if x * x + y * y <= D * D:

        cnt += 1

        

print(cnt)
N, D = list(map(int, input().split()))
cnt = 0
for _ in range(N):
    x, y = list(map(int, input().split()))
    if x**2 + y**2 <= D**2:
        cnt += 1
print(cnt)

N, D = list(map(int, input().split()))
cnt = 0
for _ in range(N):
    x, y = list(map(int, input().split()))
    if x * x + y * y <= D * D:
        cnt += 1
print(cnt)

-    if x**2 + y**2 <= D**2: +    if x * x + y * y <= D * D: