### constant

MAX_CRD = 10000
NUM_DIV = 100

### 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)

    bxi = bx / sql
    byi = by / sql

    for dyi in (-1..1)
      yi = byi + dyi
      next if (yi < 0 || yi >= NUM_DIV)

      for dxi in (-1..1)
        xi = bxi + dxi
        next if (xi < 0 || xi >= NUM_DIV)

        for axy in ars[yi][xi]
          if ((axy[0] - bx) ** 2 + (axy[1] - by) ** 2 <= rr4)
            power += 1
          end
        end
      end
    end
  end

  puts power
end