#include<bits/stdc++.h>
#define x first
#define y second
using namespace std;
ofstream fout("ograzi.out");
FILE* fin=fopen("ograzi.in","r");
const unsigned maxb=30192;
char buf[maxb];
unsigned ptr=maxb-1;
inline unsigned getint()
{
unsigned nr=0;
while(buf[ptr]<'0'||buf[ptr]>'9')
if(++ptr>=maxb)
fread(buf,maxb,1,fin),ptr=0;
while(buf[ptr]>='0'&&buf[ptr]<='9')
{
nr=nr*10+buf[ptr]-'0';
if(++ptr>=maxb)
fread(buf,maxb,1,fin),ptr=0;
}
return nr;
}
const int DN=5e4+5;
int n,sol,w,h,m,f,g;
unordered_map<long long,int>mp;
pair<int,int>a[DN];
void add(int f,int g,int pz)
{
if(f%w)
f=1+f/w;
else
f=f/w;
if(g%h)
g=1+g/h;
else
g=g/h;
mp[1LL*f*1e7+g]=pz;
}
int vf(int f,int g,int f2,int g2)
{
int pz;
if(mp.find(1LL*f*1e7+g)==mp.end())
return 0;
pz=mp[1LL*f*1e7+g];
//cout<<pz<<' '<<f2<<' '<<g2<<'\n';
if(f2>=a[pz].x&&f2<=a[pz].x+h)
if(g2>=a[pz].y&&g2<=a[pz].y+w)
return 1;
return 0;
}
int solve(int f,int g,int f2,int g2)
{
f=f/w;
g=g/h;
int cnt=0;
if(vf(f,g,f2,g2))
return 1;
if(vf(f,g+1,f2,g2))
return 1;
if(vf(f+1,g,f2,g2))
return 1;
if(vf(f+1,g+1,f2,g2))
return 1;
if(vf(f,g-1,f2,g2))
return 1;
if(vf(f-1,g,f2,g2))
return 1;
if(vf(f-1,g-1,f2,g2))
return 1;
if(vf(f-1,g+1,f2,g2))
return 1;
if(vf(f+1,g-1,f2,g2))
return 1;
return 0;
}
int main()
{
n=getint();
m=getint();
w=getint();
h=getint();
for(int i=1;i<=n;i++)
{
a[i].x=getint();
a[i].y=getint();
add(a[i].x,a[i].y,i);
}
while(m--)
{
f=getint();
g=getint();
// cout<<'z'<<f<<' '<<g<<'\n';
sol+=solve(f,g,f,g);
}
fout<<sol;
}