ax[100000],ay[100000];
main(){
	int an,bn,R,i,bx,by,dx,dy,p;
	for(;scanf("%d%d%d",&an,&bn,&R),an|bn;){
		for(i=0;i<an;i++)
			scanf("%d%d",ax+i,ay+i);
		p=0;
		for(;bn--;){
			scanf("%d%d",&bx,&by);
			for(i=0;i<an;i++){
				dx=ax[i]-bx;
				dy=ay[i]-by;
				if(dx*dx+dy*dy<=16*R*R)
					p++;
			}
		}
		printf("%d \n",p);
	}
	exit(0);
}