#include<stdio.h>
#include<math.h>
int main(){
  int n,m,r,x[100000],y[100000],s,i,j,X,Y;
  while(scanf("%d %d %d",&n,&m,&r),n||m||r){
    s=0;
    for(i=0;i<n;i++){
      scanf("%d %d",&x[i],&y[i]);
    }
    for(i=0;i<m;i++){
      scanf("%d %d",&X,&Y);
      for(j=0;j<n;j++){
	if(hypot(x[j]-X,y[j]-Y)<4*r)s++;
      }
    }
    printf("%d\n",s);
  }
  return 0;
}