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

xy = [list(map(int, input().split())) for _ in range(n)]

x, y = [list(i) for i in zip(*xy)]

ans = 0

d = d ** 2



for i in range(n):

    if ( x[i] ** 2 + y[i] ** 2 ) <= d:

        ans += 1



print(ans)
#下手にlist作って呼び出すよりも、逐次計算するほうが早い？

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

ans = 0

d = d ** 2



for i in range(n):

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

    if d >= x ** 2 + y ** 2:

        ans += 1



print(ans)
n, d = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
ans = 0
d = d**2
for i in range(n):
    if (x[i] ** 2 + y[i] ** 2) <= d:
        ans += 1
print(ans)

# 下手にlist作って呼び出すよりも、逐次計算するほうが早い？
n, d = list(map(int, input().split()))
ans = 0
d = d**2
for i in range(n):
    x, y = list(map(int, input().split()))
    if d >= x**2 + y**2:
        ans += 1
print(ans)

+# 下手にlist作って呼び出すよりも、逐次計算するほうが早い？ -xy = [list(map(int, input().split())) for _ in range(n)] -x, y = [list(i) for i in zip(*xy)] -    if (x[i] ** 2 + y[i] ** 2) <= d: +    x, y = list(map(int, input().split())) +    if d >= x**2 + y**2: