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

x = [input().split() for i in range(n)]

D = d**2

ans = 0

for i in range(n):

  kyori = int(x[i][0])**2 + int(x[i][1])**2

  if kyori <= D:

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

  D = x **2 + y ** 2

  if D <= d **2:

    ans = ans + 1

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

-x = [input().split() for i in range(n)] -D = d**2 -    kyori = int(x[i][0]) ** 2 + int(x[i][1]) ** 2 -    if kyori <= D: +    x, y = list(map(int, input().split())) +    D = x**2 + y**2 +    if D <= d**2: