fun main(args: Array<String>) {
    var nd = readLine()!!.split("\\s+".toRegex()).map {it.toLong()}
    val numberTests = nd[0]
    val dtmp = nd[1]
    val d = dtmp * dtmp

    var results = mutableListOf<Boolean>()

    for (i in 0..numberTests-1) {
        var xy = readLine()!!.split("\\s+".toRegex()).map {it.toLong()}
        val x = xy[0]
        val y = xy[1]

        val result = experimentB(x, y, d)
        results.add(result)
    }

    val cnt = results.filter {it == true}.size
    println(cnt)
}

fun experimentB(x : Long, y:Long, d: Long) : Boolean {
    return x * x + y * y <= d
}