#!/usr/bin/ruby
#
# 1023.rb: Amazing Graze
#

### constant

MAX_CRD = 10000
NUM_DIV = 100

### subroutines

def count_power(axys, bx, by, rr)
  count = 0

  for axy in axys
    if ((axy[0] - bx) ** 2 + (axy[1] - by) ** 2 <= rr)
      count += 1
    end
  end

  count
end

### main

sql = MAX_CRD / NUM_DIV

loop do
  an, bn, r = gets.split.map(&:to_i)
  break if (an | bn | r) == 0

  r4 = r * 4
  rr4 = r4 * r4

  ars = NUM_DIV.times.map{NUM_DIV.times.map{[]}}

  an.times do
    ax, ay = gets.split.map(&:to_i)

    xi = ax / sql
    yi = ay / sql

    ars[yi][xi] << [ax, ay]
  end
  #p ars

  power = 0

  bn.times do
    bx, by = gets.split.map(&:to_i)

    xi = bx / sql
    yi = by / sql

    rx0 = xi * sql
    ry0 = yi * sql
    rx1 = rx0 + sql
    ry1 = ry0 + sql

    dx0 = bx - rx0
    dy0 = by - ry0
    dx1 = rx1 - bx
    dy1 = ry1 - by

    dx02 = dx0 * dx0
    dy02 = dy0 * dy0
    dx12 = dx1 * dx1
    dy12 = dy1 * dy1

    power += count_power(ars[yi][xi], bx, by, rr4)

    if xi > 0 && dx0 < r4
      power += count_power(ars[yi][xi - 1], bx, by, rr4)
    end
    if xi < NUM_DIV - 1 && dx1 <= r4
      power += count_power(ars[yi][xi + 1], bx, by, rr4)
    end
    if yi > 0 && dy0 < r4
      power += count_power(ars[yi - 1][xi], bx, by, rr4)
    end
    if yi < NUM_DIV - 1 && dy1 <= r4
      power += count_power(ars[yi + 1][xi], bx, by, rr4)
    end

    if xi > 0 && yi > 0 && dx02 + dy02 < rr4
      power += count_power(ars[yi - 1][xi - 1], bx, by, rr4)
    end
    if xi < NUM_DIV - 1 && yi > 0 && dx12 + dy02 < rr4
      power += count_power(ars[yi - 1][xi + 1], bx, by, rr4)
    end
    if xi > 0 && yi < NUM_DIV - 1 && dx02 + dy12 < rr4
      power += count_power(ars[yi + 1][xi - 1], bx, by, rr4)
    end
    if xi < NUM_DIV - 1 && yi < NUM_DIV - 1 && dx12 + dy12 <= rr4
      power += count_power(ars[yi + 1][xi + 1], bx, by, rr4)
    end
  end

  puts power
end